Skip to content

Commit

Permalink
[zendframework#3693] CS fixes
Browse files Browse the repository at this point in the history
- trailing whitespace
- EOF endings
  • Loading branch information
weierophinney committed Mar 25, 2013
1 parent 5920073 commit e5545d2
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 49 deletions.
20 changes: 10 additions & 10 deletions README-GIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ repository.

### Pre-Commit Hook (Optional)

The ZF2 Travis-CI will confirm that code style standards are met
The ZF2 Travis-CI will confirm that code style standards are met
by using ```php-cs-fixer``` (https://github.com/fabpot/PHP-CS-Fixer) during it's build runs.
To reduce the number of red Travis-CI builds, the following Git pre-commit hook
Expand All @@ -85,13 +85,13 @@ can help catch code style issues before committing. Save it as
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP errors (lint), and make sure the
*
* This pre-commit hooks will check for PHP errors (lint), and make sure the
* code is PSR-2 compliant.
*
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
* @author Mardix http://github.com/mardix
*
* @author Mardix http://github.com/mardix
* @author Matthew Weier O'Phinney http://mwop.net/
* @since 4 Sept 2012
*/
Expand Down Expand Up @@ -194,12 +194,12 @@ create a branch for fixing an issue in the tracker.
Switched to a new branch 'zf9295'
```
... do some work ...
```sh
% git commit
```
... write your log message ...
```sh
% git push origin HEAD:zf9295
Counting objects: 38, done.
Expand Down Expand Up @@ -249,7 +249,7 @@ Once you know that your changes have been accepted to the master
repository, we suggest doing some cleanup of these branches.
- Local branch cleanup
```sh
% git branch -d <branchname>
```
Expand All @@ -275,4 +275,4 @@ on GitHub.
## CONTRIBUTORS AND COMMITTERS
Both Zend's internal Zend Framework team and the members of the Community Review
team have push privileges to the ZF2 repository.
team have push privileges to the ZF2 repository.
6 changes: 3 additions & 3 deletions library/Zend/Navigation/Page/AbstractPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ abstract class AbstractPage extends AbstractContainer
* @var string|null
*/
protected $privilege;

/**
* Permission associated with this page
*
Expand Down Expand Up @@ -706,7 +706,7 @@ public function getPrivilege()
{
return $this->privilege;
}

/**
* Sets permission associated with this page
*
Expand Down Expand Up @@ -1188,4 +1188,4 @@ protected static function normalizePropertyName($property)
* @return string the page's href
*/
abstract public function getHref();
}
}
50 changes: 25 additions & 25 deletions library/Zend/View/Helper/Navigation/AbstractHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ abstract class AbstractHelper extends View\Helper\AbstractHtmlElement implements
TranslatorAwareInterface
{
/**
* @var EventManagerInterface
* @var EventManagerInterface
*/
protected $events;

/**
* @var ServiceLocatorInterface
*/
Expand Down Expand Up @@ -159,7 +159,7 @@ public function getServiceLocator()

/**
* Set the event manager.
*
*
* @param EventManagerInterface $events
* @return AbstractHelper
*/
Expand All @@ -169,28 +169,28 @@ public function setEventManager(EventManagerInterface $events)
__CLASS__,
get_called_class(),
));

$this->events = $events;

$this->setDefaultListeners();

return $this;
}

/**
* Get the event manager.
*
*
* @return EventManagerInterface
*/
public function getEventManager()
{
if (null === $this->events) {
$this->setEventManager(new EventManager());
}

return $this->events;
}

/**
* Sets navigation container the helper operates on by default
*
Expand Down Expand Up @@ -765,43 +765,43 @@ public function getTranslatorTextDomain()

/**
* Determines whether a page should be accepted when iterating
*
* Default listener may be 'overridden' by attaching listener to 'isAllowed'
* method. Listener must be 'short circuited' if overriding default ACL
* listener.
*
* Default listener may be 'overridden' by attaching listener to 'isAllowed'
* method. Listener must be 'short circuited' if overriding default ACL
* listener.
*
* Rules:
* - If a page is not visible it is not accepted, unless RenderInvisible has
* been set to true
* - If $useAcl is true (default is true):
* - Page is accepted if listener returns true, otherwise false
* - Page is accepted if listener returns true, otherwise false
* - If page is accepted and $recursive is true, the page
* will not be accepted if it is the descendant of a non-accepted page
*
* @param AbstractPage $page page to check
* @param bool $recursive [optional] if true, page will not be
* accepted if it is the descendant of
* accepted if it is the descendant of
* a page that is not accepted. Default
* is true
*
*
* @return bool Whether page should be accepted
*/
public function accept(AbstractPage $page, $recursive = true)
{
$accept = true;

if (!$page->isVisible(false) && !$this->getRenderInvisible()) {
$accept = false;
} elseif ($this->getUseAcl()) {
$acl = $this->getAcl();
$role = $this->getRole();
$params = array('acl' => $acl, 'page' => $page, 'role' => $role);
$accept = $this->isAllowed($params);
}
}

if ($accept && $recursive) {
$parent = $page->getParent();

if ($parent instanceof AbstractPage) {
$accept = $this->accept($parent, true);
}
Expand All @@ -814,7 +814,7 @@ public function accept(AbstractPage $page, $recursive = true)
* Determines whether a page should be allowed given certain parameters
*
* @param array $params
* @return boolean
* @return boolean
*/
protected function isAllowed($params)
{
Expand Down Expand Up @@ -914,7 +914,7 @@ public static function setDefaultRole($role = null)
));
}
}

/**
* Attaches default ACL listeners, if ACLs are in use
*/
Expand All @@ -923,10 +923,10 @@ protected function setDefaultListeners()
if (!$this->getUseAcl()) {
return;
}

$this->getEventManager()->getSharedManager()->attach(
'Zend\View\Helper\Navigation\AbstractHelper',
'isAllowed',
'Zend\View\Helper\Navigation\AbstractHelper',
'isAllowed',
array('Zend\View\Helper\Navigation\Listener\AclListener', 'accept')
);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/View/Helper/Navigation/HelperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public function __toString();
* @throws \Zend\View\Exception\ExceptionInterface if unable to render
*/
public function render($container = null);
}
}
14 changes: 7 additions & 7 deletions library/Zend/View/Helper/Navigation/Listener/AclListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class AclListener
{
/**
* Determines whether a page should be accepted by ACL when iterating
*
*
* - If helper has no ACL, page is accepted
* - If page has a resource or privilege defined, page is accepted if the
* - If page has a resource or privilege defined, page is accepted if the
* ACL allows access to it using the helper's role
* - If page has no resource or privilege, page is accepted
* - If helper has ACL and role:
* - Page is accepted if it has no resource or privilege.
* - Page is accepted if ACL allows page's resource or privilege.
*
*
* @param MvcEvent $event
* @return boolean
*/
Expand All @@ -37,7 +37,7 @@ public static function accept(Event $event)
$acl = $params['acl'];
$page = $params['page'];
$role = $params['role'];

if (!$acl) {
return $accepted;
}
Expand All @@ -46,9 +46,9 @@ public static function accept(Event $event)
$privilege = $page->getPrivilege();

if ($resource || $privilege) {
$accepted = $acl->hasResource($resource)
&& $acl->isAllowed($role, $resource, $privilege);
}
$accepted = $acl->hasResource($resource)
&& $acl->isAllowed($role, $resource, $privilege);
}

return $accepted;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
compress me
compress me
2 changes: 1 addition & 1 deletion tests/ZendTest/Navigation/Page/MvcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,4 @@ public function testNoExceptionForGetHrefIfDefaultRouterIsSet()
$page->getHref();
$page->setDefaultRouter(null);
}
}
}
2 changes: 1 addition & 1 deletion tests/ZendTest/Navigation/Page/PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1157,4 +1157,4 @@ public function testToArrayMethod()
ksort($toArray);
$this->assertEquals($options, $toArray);
}
}
}

0 comments on commit e5545d2

Please sign in to comment.