Skip to content

Commit

Permalink
#153 Coding style fixes for PHP 7.1
Browse files Browse the repository at this point in the history
Remove time limit for coding style check in composer.json
  • Loading branch information
j3nsch committed Jan 17, 2023
1 parent 97ba98f commit c6ed037
Show file tree
Hide file tree
Showing 167 changed files with 446 additions and 548 deletions.
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@
"Composer\\Config::disableProcessTimeout",
"phpunit --log-junit build/phpunit.xml --colors=always --configuration tests/phpunit.xml"
],
"cs-check": "phpcs -np --extensions=php,phtml,css,js,inc",
"cs-fix": "phpcbf --extensions=php,phtml,css,js,inc",
"cs-check": [
"Composer\\Config::disableProcessTimeout",
"phpcs -np --extensions=php,phtml,css,js,inc"
],
"cs-fix": [
"Composer\\Config::disableProcessTimeout",
"phpcbf --extensions=php,phtml,css,js,inc"
],
"cs-analysis": "phpcs -n --report=checkstyle --report-file=build/checkstyle.xml",
"phpmd": "phpmd library xml cleancode,unusedcode,design,naming --reportfile build/phpmd.xml --ignore-violations-on-exit",
"phploc": "phploc --log-csv build/phploc.csv src",
Expand Down
4 changes: 0 additions & 4 deletions library/Application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ protected function _initBaseUrl()

/**
* Setup \Zend_Cache for caching application data and register under '\Zend_Cache_Page'.
*
* @return void
*/
protected function _setupPageCache()
{
Expand Down Expand Up @@ -353,8 +351,6 @@ protected function _initNavigation()

/**
* Initializes navigation container for main menu.
*
* @return void
*/
protected function _initMainMenu()
{
Expand Down
15 changes: 4 additions & 11 deletions library/Application/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,16 @@ class Application_Configuration extends Config
/** @var bool Is language selection active in user interface. */
private $languageSelectionEnabled;

/**
* Path to folder for temporary files.
*
* @var string
*/
private $tempPath;

/** @var string */
private $defaultLanguage;

/** @var Application_Configuration */
/** @var self */
private static $instance;

/**
* Returns instance of class.
*
* @return Application_Configuration
* @return self
*/
public static function getInstance()
{
Expand Down Expand Up @@ -307,8 +300,8 @@ public function getValue($key)
* Updates a value in a Zend_Config object.
*
* @param Zend_Config $config
* @param string $option Name of option
* @param string $value New value for option
* @param string $option Name of option
* @param string $value New value for option
* @throws Zend_Exception
* TODO review and if possible replace this code with something simpler
*/
Expand Down
4 changes: 2 additions & 2 deletions library/Application/Configuration/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function isPublic()
/**
* Validates requirments for using module.
*
* @return bool - true if module can be used
* @return true - true if module can be used
*/
public function validateSetup()
{
Expand All @@ -122,7 +122,7 @@ public function validateSetup()
/**
* Returns true if the module has configurable options.
*
* @return bool true - if module has options
* @return false true - if module has options
*/
public function isConfigurable()
{
Expand Down
6 changes: 3 additions & 3 deletions library/Application/Configuration/ModuleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ public function getDescription();
/**
* Returns true if the module has been registered with a custom descriptor.
*
* @return boolean
* @return bool
*/
public function isRegistered();

/**
* Returns true if 'guest' has access to the module.
*
* @return boolean
* @return bool
*/
public function isPublic();

Expand All @@ -76,7 +76,7 @@ public function validateSetup();
/**
* Returns true if the module can be configured.
*
* @return boolean
* @return bool
*/
public function isConfigurable();
}
6 changes: 3 additions & 3 deletions library/Application/Controller/Action/Helper/Dates.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function direct($datestr)
* Checks if date string is valid for current locale.
*
* @param string $datestr Date string
* @return boolean TRUE - Only if date string is valid for current local
* @return bool TRUE - Only if date string is valid for current local
*/
public function isValid($datestr)
{
Expand All @@ -62,7 +62,7 @@ public function isValid($datestr)
* Converts string to Date depending on current language.
*
* @param string $datestr Date string
* @return Date
* @return Date|null
*/
public function getOpusDate($datestr)
{
Expand All @@ -82,7 +82,7 @@ public function getOpusDate($datestr)
* Converts Date into string depending on current language.
*
* @param Date $date Date
* @return string Date string for current language
* @return string|null Date string for current language
*/
public function getDateString($date)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Application_Controller_Action_Helper_DocumentTypes extends Zend_Controller
/**
* Variable to store document types for additional calls.
*
* @var array($docTypeName => $docTypeName)
* @var array ($docTypeName => $docTypeName)
*/
private $docTypes;

Expand Down Expand Up @@ -119,7 +119,7 @@ public function getAllDocumentTypes()
* Checks if a document type is supported.
*
* @param string $documentType
* @return boolean
* @return bool
*/
public function isValid($documentType)
{
Expand Down Expand Up @@ -163,7 +163,7 @@ public function getDocument($documentType)
* This method does NOT check if the corresponding PHTML file exist or is readable.
*
* @param string $documentType
* @return string
* @return string|null
*/
public function getTemplateName($documentType)
{
Expand Down Expand Up @@ -459,7 +459,7 @@ public function getXmlSchemaPath()
* Returns the actual path for a document type definition file.
*
* @param string $name Name of document type
* @return string Path to document type definition file
* @return string|null Path to document type definition file
*/
public function getPathForDocumentType($name)
{
Expand Down
10 changes: 5 additions & 5 deletions library/Application/Controller/Action/Helper/Documents.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class Application_Controller_Action_Helper_Documents extends Zend_Controller_Act
/**
* Gets called when the helper is used like a function of the helper broker.
*
* @param string $sortOrder
* @param boolean $sortReverse
* @param string $state ('published', 'unpublished', ...)
* @param null|string $sortOrder
* @param bool $sortReverse
* @param string $state ('published', 'unpublished', ...)
* @return array of document identifiers
*/
public function direct($sortOrder = null, $sortReverse = 0, $state = 'published')
Expand All @@ -56,7 +56,7 @@ public function direct($sortOrder = null, $sortReverse = 0, $state = 'published'
* Returns Document for provided ID or throws exception.
*
* @param string $docId Document identifier
* @return DocumentInterface
* @return DocumentInterface|null
*/
public function getDocumentForId($docId)
{
Expand All @@ -78,7 +78,7 @@ public function getDocumentForId($docId)
* Returns documents from database for browsing.
*
* @param string|null $sortOrder
* @param boolean $sortReverse
* @param bool $sortReverse
* @param string|null $state
* @return int[] Document identifiers
*
Expand Down
41 changes: 20 additions & 21 deletions library/Application/Controller/Action/Helper/Redirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ public function init()
/**
* Redirects to an action / controller / module, sets a message for the redirect target view.
*
* @param string $action The redirect target action
* @param string $message The message to be displayed
* @param string $controller The redirect target controller
* @param string $module The redirect target model
* @param array $params Parameters for the redirect target action
* @return void
* @param string $action The redirect target action
* @param null|string $message The message to be displayed
* @param null|string $controller The redirect target controller
* @param null|string $module The redirect target model
* @param array $params Parameters for the redirect target action
*/
public function redirectTo(
$action,
Expand All @@ -68,11 +67,11 @@ public function redirectTo(
/**
* Performs a permanent (301) redirect.
*
* @param string $action The target action.
* @param string $message The message to be displayed.
* @param string $controller The target controller.
* @param string $module The target module.
* @param array $params Optional request parameters.
* @param string $action The target action.
* @param null|string $message The message to be displayed.
* @param null|string $controller The target controller.
* @param null|string $module The target module.
* @param array $params Optional request parameters.
*/
public function redirectToPermanent(
$action,
Expand All @@ -86,11 +85,11 @@ public function redirectToPermanent(
}

/**
* @param string $action
* @param string $message
* @param string $controller
* @param string $module
* @param array $params
* @param string $action
* @param null|string $message
* @param null|string $controller
* @param null|string $module
* @param array $params
* @throws Application_Exception
*/
public function redirectToPermanentAndExit(
Expand All @@ -105,11 +104,11 @@ public function redirectToPermanentAndExit(
}

/**
* @param string $action
* @param string $message
* @param string $controller
* @param string $module
* @param array $params
* @param string $action
* @param null|string $message
* @param null|string $controller
* @param null|string $module
* @param array $params
* @throws Application_Exception
*/
public function redirectToAndExit(
Expand Down
6 changes: 3 additions & 3 deletions library/Application/Controller/Action/Helper/SendFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public function direct($file, $method = self::FPASSTHRU, $mustResend = false)
/**
* This method to call when we use $this->_helper->SendFile(...)
*
* @param string $file Absoulte filename of file to send.
* @param string $method defaults to self::FPASSTHRU, use self::XSENDFILE for X-Sendfile
* @param boolean $mustResend Ignore "if-modified-since" header, defaults to false.
* @param string $file Absoulte filename of file to send.
* @param string $method defaults to self::FPASSTHRU, use self::XSENDFILE for X-Sendfile
* @param bool $mustResend Ignore "if-modified-since" header, defaults to false.
*/
public function sendFile($file, $method = self::FPASSTHRU, $mustResend = false)
{
Expand Down
8 changes: 4 additions & 4 deletions library/Application/Controller/Action/Helper/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function direct($document)
* Returns true if a requested state is valid.
*
* @param string $state
* @return boolean TRUE - only if the state string exists
* @return bool TRUE - only if the state string exists
*/
public function isValidState($state)
{
Expand All @@ -77,8 +77,8 @@ public function isValidState($state)
* Returns true if a transition is allowed for a document.
*
* @param DocumentInterface $document
* @param string $targetState
* @return boolean - True only if transition is allowed
* @param string $targetState
* @return bool - True only if transition is allowed
*/
public function isTransitionAllowed($document, $targetState)
{
Expand Down Expand Up @@ -156,7 +156,7 @@ public static function getTargetStates($currentState)
* Performs state change on document.
*
* @param DocumentInterface $document
* @param string $targetState
* @param string $targetState
*
* TODO enforcing permissions and throwing exceptions (OPUSVIER-1959)
*/
Expand Down
14 changes: 3 additions & 11 deletions library/Application/Controller/ActionCRUD.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ public function init()

/**
* List all available model instances.
*
* @return void
*/
public function indexAction()
{
Expand All @@ -193,8 +191,6 @@ public function getIndexForm()
* Zeigt das Model an.
*
* Für die Anzeige wird das Model-Formular im "View"-Modus verwendet.
*
* @return void
*/
public function showAction()
{
Expand All @@ -217,8 +213,6 @@ public function showAction()

/**
* Zeigt Formular für neues Model und erzeugt neues Model.
*
* @return void
*/
public function newAction()
{
Expand All @@ -237,8 +231,6 @@ public function newAction()

/**
* Edits a model instance
*
* @return void
*/
public function editAction()
{
Expand Down Expand Up @@ -481,7 +473,7 @@ public function createCannotBeDeletedResult()
*
* Das Bestätigunsformular ohne Model wird für die Validierung verwendet.
*
* @param PersistableInterface $model
* @param null|PersistableInterface $model
* @return Application_Form_Confirmation
*/
public function getConfirmationForm($model = null)
Expand Down Expand Up @@ -524,7 +516,7 @@ public function getNewModel()
* Liefert Instanz des Models.
*
* @param int|string $modelId
* @return ModelInterface
* @return ModelInterface|null
*/
public function getModel($modelId)
{
Expand Down Expand Up @@ -748,7 +740,7 @@ public function getShowActionEnabled()
* Determines if a model can be edited.
*
* @param ModelInterface $model
* @return bool true if object can be edited; false - object cannot be edited
* @return true true if object can be edited; false - object cannot be edited
*/
public function isModifiable($model)
{
Expand Down
2 changes: 1 addition & 1 deletion library/Application/Controller/ModuleAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected function isPageForRequestInNavigation($navigation)
* Method stub to be overridden by controllers. Enables checks for custom
* properties.
*
* @return bool
* @return true
*/
protected function customAccessCheck()
{
Expand Down
Loading

0 comments on commit c6ed037

Please sign in to comment.