From f211e417bf637b8a83988175c29ee072c69f7642 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 00:19:03 +0200 Subject: lint: apply phpcbf to application/ Signed-off-by: VirtualTam --- application/LinkDB.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'application/LinkDB.php') diff --git a/application/LinkDB.php b/application/LinkDB.php index cdd68cfb..1f7c28cd 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -107,8 +107,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess $hidePublicLinks, $redirector = '', $redirectorEncode = true - ) - { + ) { $this->datastore = $datastore; $this->loggedIn = $isLoggedIn; $this->hidePublicLinks = $hidePublicLinks; @@ -317,8 +316,7 @@ You use the community supported version of the original Shaarli project, by Seba } else { $link['real_url'] .= $link['url']; } - } - else { + } else { $link['real_url'] = $link['url']; } @@ -403,7 +401,8 @@ You use the community supported version of the original Shaarli project, by Seba * * @return array list of shaare found. */ - public function filterDay($request) { + public function filterDay($request) + { $linkFilter = new LinkFilter($this->links); return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request); } @@ -492,8 +491,7 @@ You use the community supported version of the original Shaarli project, by Seba $delete = empty($to); // True for case-sensitive tag search. $linksToAlter = $this->filterSearch(['searchtags' => $from], true); - foreach($linksToAlter as $key => &$value) - { + foreach ($linksToAlter as $key => &$value) { $tags = preg_split('/\s+/', trim($value['tags'])); if (($pos = array_search($from, $tags)) !== false) { if ($delete) { @@ -536,7 +534,7 @@ You use the community supported version of the original Shaarli project, by Seba { $order = $order === 'ASC' ? -1 : 1; // Reorder array by dates. - usort($this->links, function($a, $b) use ($order) { + usort($this->links, function ($a, $b) use ($order) { if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) { return $a['sticky'] ? -1 : 1; } -- cgit v1.2.3 From 9d9f6d75b94aab51067bdfbe50b58b66d1194f6d Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 01:40:04 +0200 Subject: lint: fix line-length warnings Signed-off-by: VirtualTam --- application/LinkDB.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'application/LinkDB.php') diff --git a/application/LinkDB.php b/application/LinkDB.php index 1f7c28cd..4bbc2950 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -249,11 +249,14 @@ class LinkDB implements Iterator, Countable, ArrayAccess 'id' => 1, 'title'=> t('The personal, minimalist, super-fast, database free, bookmarking service'), 'url'=>'https://shaarli.readthedocs.io', - 'description'=>t('Welcome to Shaarli! This is your first public bookmark. To edit or delete me, you must first login. + 'description'=>t( + 'Welcome to Shaarli! This is your first public bookmark. ' + .'To edit or delete me, you must first login. To learn how to use Shaarli, consult the link "Documentation" at the bottom of this page. -You use the community supported version of the original Shaarli project, by Sebastien Sauvage.'), +You use the community supported version of the original Shaarli project, by Sebastien Sauvage.' + ), 'private'=>0, 'created'=> new DateTime(), 'tags'=>'opensource software' @@ -419,8 +422,12 @@ You use the community supported version of the original Shaarli project, by Seba * * @return array filtered links, all links if no suitable filter was provided. */ - public function filterSearch($filterRequest = array(), $casesensitive = false, $visibility = 'all', $untaggedonly = false) - { + public function filterSearch( + $filterRequest = array(), + $casesensitive = false, + $visibility = 'all', + $untaggedonly = false + ) { // Filter link database according to parameters. $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : ''; $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : ''; -- cgit v1.2.3