diff --git a/src/B8Framework/Application.php b/src/B8Framework/Application.php old mode 100755 new mode 100644 index 9546f36c..c86c00df --- a/src/B8Framework/Application.php +++ b/src/B8Framework/Application.php @@ -4,7 +4,6 @@ namespace b8; use b8\Exception\HttpException\NotFoundException; use b8\Http; -use b8\View; use b8\Http\Response; use b8\Http\Request; diff --git a/src/B8Framework/Cache.php b/src/B8Framework/Cache.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Cache/ApcCache.php b/src/B8Framework/Cache/ApcCache.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Cache/RequestCache.php b/src/B8Framework/Cache/RequestCache.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Config.php b/src/B8Framework/Config.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Controller.php b/src/B8Framework/Controller.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Database.php b/src/B8Framework/Database.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException.php b/src/B8Framework/Exception/HttpException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/BadRequestException.php b/src/B8Framework/Exception/HttpException/BadRequestException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/ForbiddenException.php b/src/B8Framework/Exception/HttpException/ForbiddenException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/NotAuthorizedException.php b/src/B8Framework/Exception/HttpException/NotAuthorizedException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/NotFoundException.php b/src/B8Framework/Exception/HttpException/NotFoundException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/ServerErrorException.php b/src/B8Framework/Exception/HttpException/ServerErrorException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Exception/HttpException/ValidationException.php b/src/B8Framework/Exception/HttpException/ValidationException.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form.php b/src/B8Framework/Form.php old mode 100755 new mode 100644 index 01ebe157..941bc857 --- a/src/B8Framework/Form.php +++ b/src/B8Framework/Form.php @@ -29,12 +29,12 @@ class Form extends FieldSet $this->_method = $method; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { $view->action = $this->getAction(); $view->method = $this->getMethod(); - parent::_onPreRender($view); + parent::onPreRender($view); } public function __toString() diff --git a/src/B8Framework/Form/ControlGroup.php b/src/B8Framework/Form/ControlGroup.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/Element.php b/src/B8Framework/Form/Element.php old mode 100755 new mode 100644 index 519dee19..a4f81693 --- a/src/B8Framework/Form/Element.php +++ b/src/B8Framework/Form/Element.php @@ -104,10 +104,10 @@ abstract class Element $view->ccss = $this->getContainerClass(); $view->parent = $this->_parent; - $this->_onPreRender($view); + $this->onPreRender($view); return $view->render(); } - abstract protected function _onPreRender(View &$view); + abstract protected function onPreRender(View &$view); } diff --git a/src/B8Framework/Form/Element/Button.php b/src/B8Framework/Form/Element/Button.php old mode 100755 new mode 100644 index 5250573e..26110100 --- a/src/B8Framework/Form/Element/Button.php +++ b/src/B8Framework/Form/Element/Button.php @@ -11,9 +11,9 @@ class Button extends Input return true; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'button'; } } diff --git a/src/B8Framework/Form/Element/Checkbox.php b/src/B8Framework/Form/Element/Checkbox.php old mode 100755 new mode 100644 index ec8fa60d..dd7b7108 --- a/src/B8Framework/Form/Element/Checkbox.php +++ b/src/B8Framework/Form/Element/Checkbox.php @@ -21,14 +21,14 @@ class Checkbox extends Input public function setValue($value) { - if (is_bool($value) && $value == true) { - $this->_value = $this->getCheckedValue(); + if (is_bool($value) && $value === true) { + $this->_value = $this->getCheckedValue(); $this->_checked = true; return; } if ($value == $this->getCheckedValue()) { - $this->_value = $this->getCheckedValue(); + $this->_value = $this->getCheckedValue(); $this->_checked = true; return; } @@ -37,10 +37,10 @@ class Checkbox extends Input $this->_checked = false; } - public function _onPreRender(View &$view) + public function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->checkedValue = $this->getCheckedValue(); - $view->checked = $this->_checked; + $view->checked = $this->_checked; } } diff --git a/src/B8Framework/Form/Element/CheckboxGroup.php b/src/B8Framework/Form/Element/CheckboxGroup.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/Element/Csrf.php b/src/B8Framework/Form/Element/Csrf.php old mode 100755 new mode 100644 index 3e9712ce..3df0c247 --- a/src/B8Framework/Form/Element/Csrf.php +++ b/src/B8Framework/Form/Element/Csrf.php @@ -17,9 +17,9 @@ class Csrf extends Hidden return true; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $csrf = md5(microtime(true)); $view->csrf = $csrf; setcookie($this->getName(), $csrf); diff --git a/src/B8Framework/Form/Element/Email.php b/src/B8Framework/Form/Element/Email.php old mode 100755 new mode 100644 index 922e1a97..7726a2b9 --- a/src/B8Framework/Form/Element/Email.php +++ b/src/B8Framework/Form/Element/Email.php @@ -11,9 +11,9 @@ class Email extends Text return parent::render(($viewFile ? $viewFile : 'Text')); } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'email'; } } diff --git a/src/B8Framework/Form/Element/Hidden.php b/src/B8Framework/Form/Element/Hidden.php old mode 100755 new mode 100644 index 5643903f..ebb427e7 --- a/src/B8Framework/Form/Element/Hidden.php +++ b/src/B8Framework/Form/Element/Hidden.php @@ -2,7 +2,7 @@ namespace b8\Form\Element; -use b8\Form\Input, b8\View; +use b8\Form\Input; class Hidden extends Input { diff --git a/src/B8Framework/Form/Element/Password.php b/src/B8Framework/Form/Element/Password.php old mode 100755 new mode 100644 index 8239f64d..258ec873 --- a/src/B8Framework/Form/Element/Password.php +++ b/src/B8Framework/Form/Element/Password.php @@ -11,9 +11,9 @@ class Password extends Text return parent::render(($viewFile ? $viewFile : 'Text')); } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'password'; } } diff --git a/src/B8Framework/Form/Element/Radio.php b/src/B8Framework/Form/Element/Radio.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/Element/Select.php b/src/B8Framework/Form/Element/Select.php old mode 100755 new mode 100644 index 902a3954..7119c637 --- a/src/B8Framework/Form/Element/Select.php +++ b/src/B8Framework/Form/Element/Select.php @@ -13,9 +13,9 @@ class Select extends Input $this->_options = $options; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->options = $this->_options; } } diff --git a/src/B8Framework/Form/Element/Submit.php b/src/B8Framework/Form/Element/Submit.php old mode 100755 new mode 100644 index c04196b1..5d0cbfdb --- a/src/B8Framework/Form/Element/Submit.php +++ b/src/B8Framework/Form/Element/Submit.php @@ -13,9 +13,9 @@ class Submit extends Button return parent::render(($viewFile ? $viewFile : 'Button')); } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'submit'; } } diff --git a/src/B8Framework/Form/Element/Text.php b/src/B8Framework/Form/Element/Text.php old mode 100755 new mode 100644 index 658e40b8..6aa04ba6 --- a/src/B8Framework/Form/Element/Text.php +++ b/src/B8Framework/Form/Element/Text.php @@ -6,9 +6,9 @@ use b8\Form\Input, b8\View; class Text extends Input { - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'text'; } } diff --git a/src/B8Framework/Form/Element/TextArea.php b/src/B8Framework/Form/Element/TextArea.php old mode 100755 new mode 100644 index 2c640ea3..14f54e1f --- a/src/B8Framework/Form/Element/TextArea.php +++ b/src/B8Framework/Form/Element/TextArea.php @@ -18,9 +18,9 @@ class TextArea extends Text $this->_rows = $rows; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->rows = $this->getRows(); } } diff --git a/src/B8Framework/Form/Element/Url.php b/src/B8Framework/Form/Element/Url.php old mode 100755 new mode 100644 index 6ce621d8..1f5580e8 --- a/src/B8Framework/Form/Element/Url.php +++ b/src/B8Framework/Form/Element/Url.php @@ -11,9 +11,9 @@ class Url extends Text return parent::render(($viewFile ? $viewFile : 'Text')); } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { - parent::_onPreRender($view); + parent::onPreRender($view); $view->type = 'url'; } } diff --git a/src/B8Framework/Form/FieldSet.php b/src/B8Framework/Form/FieldSet.php old mode 100755 new mode 100644 index 6899e9a6..fefc5915 --- a/src/B8Framework/Form/FieldSet.php +++ b/src/B8Framework/Form/FieldSet.php @@ -70,7 +70,7 @@ class FieldSet extends Element return $rtn; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { $rendered = []; foreach ($this->_children as $child) { diff --git a/src/B8Framework/Form/Input.php b/src/B8Framework/Form/Input.php old mode 100755 new mode 100644 index 1c6d591d..46c20043 --- a/src/B8Framework/Form/Input.php +++ b/src/B8Framework/Form/Input.php @@ -107,7 +107,7 @@ class Input extends Element return $this; } - protected function _onPreRender(View &$view) + protected function onPreRender(View &$view) { $view->value = $this->getValue(); $view->error = $this->_error; diff --git a/src/B8Framework/Form/View/Button.phtml b/src/B8Framework/Form/View/Button.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Checkbox.phtml b/src/B8Framework/Form/View/Checkbox.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/CheckboxGroup.phtml b/src/B8Framework/Form/View/CheckboxGroup.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/ControlGroup.phtml b/src/B8Framework/Form/View/ControlGroup.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Csrf.phtml b/src/B8Framework/Form/View/Csrf.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/FieldSet.phtml b/src/B8Framework/Form/View/FieldSet.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Form.phtml b/src/B8Framework/Form/View/Form.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Hidden.phtml b/src/B8Framework/Form/View/Hidden.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Radio.phtml b/src/B8Framework/Form/View/Radio.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Select.phtml b/src/B8Framework/Form/View/Select.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/Text.phtml b/src/B8Framework/Form/View/Text.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Form/View/TextArea.phtml b/src/B8Framework/Form/View/TextArea.phtml old mode 100755 new mode 100644 diff --git a/src/B8Framework/Http/Request.php b/src/B8Framework/Http/Request.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Http/Response.php b/src/B8Framework/Http/Response.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Http/Response/JsonResponse.php b/src/B8Framework/Http/Response/JsonResponse.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Http/Response/RedirectResponse.php b/src/B8Framework/Http/Response/RedirectResponse.php old mode 100755 new mode 100644 index b400fefb..a5c711fe --- a/src/B8Framework/Http/Response/RedirectResponse.php +++ b/src/B8Framework/Http/Response/RedirectResponse.php @@ -22,6 +22,6 @@ class RedirectResponse extends Response public function flush() { parent::flush(); - die; + exit(1); } } diff --git a/src/B8Framework/Http/Router.php b/src/B8Framework/Http/Router.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/HttpClient.php b/src/B8Framework/HttpClient.php old mode 100755 new mode 100644 index c6a571b6..19decf68 --- a/src/B8Framework/HttpClient.php +++ b/src/B8Framework/HttpClient.php @@ -64,7 +64,7 @@ class HttpClient $res['headers'] = $http_response_header; $res['code'] = (int)preg_replace('/HTTP\/1\.[0-1] ([0-9]+)/', '$1', $res['headers'][0]); $res['success'] = false; - $res['body'] = $this->_decodeResponse($result); + $res['body'] = $this->decodeResponse($result); if ($res['code'] >= 200 && $res['code'] < 300) { $res['success'] = true; @@ -103,13 +103,13 @@ class HttpClient return $this->request('DELETE', $uri, $params); } - protected function _decodeResponse($originalResponse) + protected function decodeResponse($originalResponse) { $response = $originalResponse; $body = ''; do { - $line = $this->_readChunk($response); + $line = $this->readChunk($response); if ($line == PHP_EOL) { continue; @@ -122,7 +122,7 @@ class HttpClient } do { - $data = $this->_readChunk($response, $length); + $data = $this->readChunk($response, $length); // remove the amount received from the total length on the next loop // it'll attempt to read that much less data @@ -145,7 +145,7 @@ class HttpClient return $body; } - protected function _readChunk(&$string, $len = 4096) + protected function readChunk(&$string, $len = 4096) { $rtn = ''; for ($i = 0; $i <= $len; $i++) { diff --git a/src/B8Framework/Image.php b/src/B8Framework/Image.php old mode 100755 new mode 100644 index f3806d9b..903be7ab --- a/src/B8Framework/Image.php +++ b/src/B8Framework/Image.php @@ -65,7 +65,7 @@ class Image $sourceRatio = $sourceWidth / $sourceHeight; $targetRatio = $height != 'auto' ? $width / $height : $sourceRatio; - $quads = $this->_getQuadrants($sourceWidth, $sourceHeight); + $quads = $this->getQuadrants($sourceWidth, $sourceHeight); foreach($quads as $name => $l) { @@ -133,7 +133,7 @@ class Image return $source; } - protected function _getQuadrants($x, $y) + protected function getQuadrants($x, $y) { $rtn = []; $rtn['top_left'] = [0, $x / 2, 0, $y / 3]; diff --git a/src/B8Framework/Model.php b/src/B8Framework/Model.php old mode 100755 new mode 100644 index fb59a189..d7eb3497 --- a/src/B8Framework/Model.php +++ b/src/B8Framework/Model.php @@ -39,13 +39,13 @@ class Model $rtn = []; foreach ($sleepable as $property) { - $rtn[$property] = $this->_propertyToArray($property, $currentDepth, $depth); + $rtn[$property] = $this->propertyToArray($property, $currentDepth, $depth); } return $rtn; } - protected function _propertyToArray($property, $currentDepth, $depth) + protected function propertyToArray($property, $currentDepth, $depth) { $rtn = null; @@ -54,14 +54,14 @@ class Model $rtn = $this->{$method}(); if (is_object($rtn) || is_array($rtn)) { - $rtn = ($depth > $currentDepth) ? $this->_valueToArray($rtn, $currentDepth, $depth) : null; + $rtn = ($depth > $currentDepth) ? $this->valueToArray($rtn, $currentDepth, $depth) : null; } } return $rtn; } - protected function _valueToArray($value, $currentDepth, $depth) + protected function valueToArray($value, $currentDepth, $depth) { $rtn = null; if (!is_null($value)) { @@ -71,7 +71,7 @@ class Model $childArray = []; foreach ($value as $k => $v) { - $childArray[$k] = $this->_valueToArray($v, $currentDepth + 1, $depth); + $childArray[$k] = $this->valueToArray($v, $currentDepth + 1, $depth); } $rtn = $childArray; @@ -113,19 +113,19 @@ class Model } } - protected function _setModified($column) + protected function setModified($column) { $this->modified[$column] = $column; } - protected function _validateString($name, $value) + protected function validateString($name, $value) { if (!is_string($value) && !is_null($value)) { throw new HttpException\ValidationException($name . ' must be a string.'); } } - protected function _validateInt($name, &$value) + protected function validateInt($name, &$value) { if (is_bool($value)) { $value = $value ? 1 : 0; @@ -140,7 +140,7 @@ class Model } } - protected function _validateFloat($name, &$value) + protected function validateFloat($name, &$value) { if (!is_numeric($value) && !is_null($value)) { throw new HttpException\ValidationException($name . ' must be a float.'); @@ -151,7 +151,7 @@ class Model } } - protected function _validateDate($name, &$value) + protected function validateDate($name, &$value) { if (is_string($value)) { $value = empty($value) ? null : new \DateTime($value); @@ -165,7 +165,7 @@ class Model $value = empty($value) ? null : $value->format('Y-m-d H:i:s'); } - protected function _validateNotNull($name, &$value) + protected function validateNotNull($name, &$value) { if (is_null($value)) { throw new HttpException\ValidationException($name . ' must not be null.'); diff --git a/src/B8Framework/Store.php b/src/B8Framework/Store.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Store/Factory.php b/src/B8Framework/Store/Factory.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Type/CacheInterface.php b/src/B8Framework/Type/CacheInterface.php old mode 100755 new mode 100644 diff --git a/src/B8Framework/Type/RestUser.php b/src/B8Framework/Type/RestUser.php deleted file mode 100755 index 6b4d0f5f..00000000 --- a/src/B8Framework/Type/RestUser.php +++ /dev/null @@ -1,8 +0,0 @@ -viewFile = self::getViewFile($file, $path); diff --git a/src/B8Framework/View/Helper/Format.php b/src/B8Framework/View/Helper/Format.php deleted file mode 100755 index 0295d6dd..00000000 --- a/src/B8Framework/View/Helper/Format.php +++ /dev/null @@ -1,11 +0,0 @@ -_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -355,7 +355,7 @@ class BuildBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -365,8 +365,8 @@ class BuildBase extends Model */ public function setProjectId($value) { - $this->_validateNotNull('ProjectId', $value); - $this->_validateInt('ProjectId', $value); + $this->validateNotNull('ProjectId', $value); + $this->validateInt('ProjectId', $value); if ($this->data['project_id'] === $value) { return; @@ -374,7 +374,7 @@ class BuildBase extends Model $this->data['project_id'] = $value; - $this->_setModified('project_id'); + $this->setModified('project_id'); } /** @@ -384,8 +384,8 @@ class BuildBase extends Model */ public function setCommitId($value) { - $this->_validateNotNull('CommitId', $value); - $this->_validateString('CommitId', $value); + $this->validateNotNull('CommitId', $value); + $this->validateString('CommitId', $value); if ($this->data['commit_id'] === $value) { return; @@ -393,7 +393,7 @@ class BuildBase extends Model $this->data['commit_id'] = $value; - $this->_setModified('commit_id'); + $this->setModified('commit_id'); } /** @@ -403,8 +403,8 @@ class BuildBase extends Model */ public function setStatus($value) { - $this->_validateNotNull('Status', $value); - $this->_validateInt('Status', $value); + $this->validateNotNull('Status', $value); + $this->validateInt('Status', $value); if ($this->data['status'] === $value) { return; @@ -412,7 +412,7 @@ class BuildBase extends Model $this->data['status'] = $value; - $this->_setModified('status'); + $this->setModified('status'); } /** @@ -422,7 +422,7 @@ class BuildBase extends Model */ public function setLog($value) { - $this->_validateString('Log', $value); + $this->validateString('Log', $value); if ($this->data['log'] === $value) { return; @@ -430,7 +430,7 @@ class BuildBase extends Model $this->data['log'] = $value; - $this->_setModified('log'); + $this->setModified('log'); } /** @@ -440,8 +440,8 @@ class BuildBase extends Model */ public function setBranch($value) { - $this->_validateNotNull('Branch', $value); - $this->_validateString('Branch', $value); + $this->validateNotNull('Branch', $value); + $this->validateString('Branch', $value); if ($this->data['branch'] === $value) { return; @@ -449,7 +449,7 @@ class BuildBase extends Model $this->data['branch'] = $value; - $this->_setModified('branch'); + $this->setModified('branch'); } /** @@ -459,7 +459,7 @@ class BuildBase extends Model */ public function setCreated($value) { - $this->_validateDate('Created', $value); + $this->validateDate('Created', $value); if ($this->data['created'] === $value) { return; @@ -467,7 +467,7 @@ class BuildBase extends Model $this->data['created'] = $value; - $this->_setModified('created'); + $this->setModified('created'); } /** @@ -477,7 +477,7 @@ class BuildBase extends Model */ public function setStarted($value) { - $this->_validateDate('Started', $value); + $this->validateDate('Started', $value); if ($this->data['started'] === $value) { return; @@ -485,7 +485,7 @@ class BuildBase extends Model $this->data['started'] = $value; - $this->_setModified('started'); + $this->setModified('started'); } /** @@ -495,7 +495,7 @@ class BuildBase extends Model */ public function setFinished($value) { - $this->_validateDate('Finished', $value); + $this->validateDate('Finished', $value); if ($this->data['finished'] === $value) { return; @@ -503,7 +503,7 @@ class BuildBase extends Model $this->data['finished'] = $value; - $this->_setModified('finished'); + $this->setModified('finished'); } /** @@ -513,7 +513,7 @@ class BuildBase extends Model */ public function setCommitterEmail($value) { - $this->_validateString('CommitterEmail', $value); + $this->validateString('CommitterEmail', $value); if ($this->data['committer_email'] === $value) { return; @@ -521,7 +521,7 @@ class BuildBase extends Model $this->data['committer_email'] = $value; - $this->_setModified('committer_email'); + $this->setModified('committer_email'); } /** @@ -531,7 +531,7 @@ class BuildBase extends Model */ public function setCommitMessage($value) { - $this->_validateString('CommitMessage', $value); + $this->validateString('CommitMessage', $value); if ($this->data['commit_message'] === $value) { return; @@ -539,7 +539,7 @@ class BuildBase extends Model $this->data['commit_message'] = $value; - $this->_setModified('commit_message'); + $this->setModified('commit_message'); } /** @@ -549,7 +549,7 @@ class BuildBase extends Model */ public function setExtra($value) { - $this->_validateString('Extra', $value); + $this->validateString('Extra', $value); if ($this->data['extra'] === $value) { return; @@ -557,7 +557,7 @@ class BuildBase extends Model $this->data['extra'] = $value; - $this->_setModified('extra'); + $this->setModified('extra'); } /** diff --git a/src/PHPCensor/Model/Base/BuildErrorBase.php b/src/PHPCensor/Model/Base/BuildErrorBase.php index 9839ee01..543d1b99 100644 --- a/src/PHPCensor/Model/Base/BuildErrorBase.php +++ b/src/PHPCensor/Model/Base/BuildErrorBase.php @@ -279,8 +279,8 @@ class BuildErrorBase extends Model */ public function setId($value) { - $this->_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -288,7 +288,7 @@ class BuildErrorBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -299,8 +299,8 @@ class BuildErrorBase extends Model */ public function setBuildId($value) { - $this->_validateNotNull('BuildId', $value); - $this->_validateInt('BuildId', $value); + $this->validateNotNull('BuildId', $value); + $this->validateInt('BuildId', $value); if ($this->data['build_id'] === $value) { return; @@ -308,7 +308,7 @@ class BuildErrorBase extends Model $this->data['build_id'] = $value; - $this->_setModified('build_id'); + $this->setModified('build_id'); } /** @@ -319,8 +319,8 @@ class BuildErrorBase extends Model */ public function setPlugin($value) { - $this->_validateNotNull('Plugin', $value); - $this->_validateString('Plugin', $value); + $this->validateNotNull('Plugin', $value); + $this->validateString('Plugin', $value); if ($this->data['plugin'] === $value) { return; @@ -328,7 +328,7 @@ class BuildErrorBase extends Model $this->data['plugin'] = $value; - $this->_setModified('plugin'); + $this->setModified('plugin'); } /** @@ -338,7 +338,7 @@ class BuildErrorBase extends Model */ public function setFile($value) { - $this->_validateString('File', $value); + $this->validateString('File', $value); if ($this->data['file'] === $value) { return; @@ -346,7 +346,7 @@ class BuildErrorBase extends Model $this->data['file'] = $value; - $this->_setModified('file'); + $this->setModified('file'); } /** @@ -356,7 +356,7 @@ class BuildErrorBase extends Model */ public function setLineStart($value) { - $this->_validateInt('LineStart', $value); + $this->validateInt('LineStart', $value); if ($this->data['line_start'] === $value) { return; @@ -364,7 +364,7 @@ class BuildErrorBase extends Model $this->data['line_start'] = $value; - $this->_setModified('line_start'); + $this->setModified('line_start'); } /** @@ -374,7 +374,7 @@ class BuildErrorBase extends Model */ public function setLineEnd($value) { - $this->_validateInt('LineEnd', $value); + $this->validateInt('LineEnd', $value); if ($this->data['line_end'] === $value) { return; @@ -382,7 +382,7 @@ class BuildErrorBase extends Model $this->data['line_end'] = $value; - $this->_setModified('line_end'); + $this->setModified('line_end'); } /** @@ -393,8 +393,8 @@ class BuildErrorBase extends Model */ public function setSeverity($value) { - $this->_validateNotNull('Severity', $value); - $this->_validateInt('Severity', $value); + $this->validateNotNull('Severity', $value); + $this->validateInt('Severity', $value); if ($this->data['severity'] === $value) { return; @@ -402,7 +402,7 @@ class BuildErrorBase extends Model $this->data['severity'] = $value; - $this->_setModified('severity'); + $this->setModified('severity'); } /** @@ -413,8 +413,8 @@ class BuildErrorBase extends Model */ public function setMessage($value) { - $this->_validateNotNull('Message', $value); - $this->_validateString('Message', $value); + $this->validateNotNull('Message', $value); + $this->validateString('Message', $value); if ($this->data['message'] === $value) { return; @@ -422,7 +422,7 @@ class BuildErrorBase extends Model $this->data['message'] = $value; - $this->_setModified('message'); + $this->setModified('message'); } /** @@ -433,8 +433,8 @@ class BuildErrorBase extends Model */ public function setCreatedDate($value) { - $this->_validateNotNull('CreatedDate', $value); - $this->_validateDate('CreatedDate', $value); + $this->validateNotNull('CreatedDate', $value); + $this->validateDate('CreatedDate', $value); if ($this->data['created_date'] === $value) { return; @@ -442,7 +442,7 @@ class BuildErrorBase extends Model $this->data['created_date'] = $value; - $this->_setModified('created_date'); + $this->setModified('created_date'); } /** diff --git a/src/PHPCensor/Model/Base/BuildMetaBase.php b/src/PHPCensor/Model/Base/BuildMetaBase.php index 73ce302f..a56be7e8 100644 --- a/src/PHPCensor/Model/Base/BuildMetaBase.php +++ b/src/PHPCensor/Model/Base/BuildMetaBase.php @@ -201,8 +201,8 @@ class BuildMetaBase extends Model */ public function setId($value) { - $this->_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -210,7 +210,7 @@ class BuildMetaBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -221,8 +221,8 @@ class BuildMetaBase extends Model */ public function setProjectId($value) { - $this->_validateNotNull('ProjectId', $value); - $this->_validateInt('ProjectId', $value); + $this->validateNotNull('ProjectId', $value); + $this->validateInt('ProjectId', $value); if ($this->data['project_id'] === $value) { return; @@ -230,7 +230,7 @@ class BuildMetaBase extends Model $this->data['project_id'] = $value; - $this->_setModified('project_id'); + $this->setModified('project_id'); } /** @@ -241,8 +241,8 @@ class BuildMetaBase extends Model */ public function setBuildId($value) { - $this->_validateNotNull('BuildId', $value); - $this->_validateInt('BuildId', $value); + $this->validateNotNull('BuildId', $value); + $this->validateInt('BuildId', $value); if ($this->data['build_id'] === $value) { return; @@ -250,7 +250,7 @@ class BuildMetaBase extends Model $this->data['build_id'] = $value; - $this->_setModified('build_id'); + $this->setModified('build_id'); } /** @@ -261,8 +261,8 @@ class BuildMetaBase extends Model */ public function setMetaKey($value) { - $this->_validateNotNull('MetaKey', $value); - $this->_validateString('MetaKey', $value); + $this->validateNotNull('MetaKey', $value); + $this->validateString('MetaKey', $value); if ($this->data['meta_key'] === $value) { return; @@ -270,7 +270,7 @@ class BuildMetaBase extends Model $this->data['meta_key'] = $value; - $this->_setModified('meta_key'); + $this->setModified('meta_key'); } /** @@ -281,8 +281,8 @@ class BuildMetaBase extends Model */ public function setMetaValue($value) { - $this->_validateNotNull('MetaValue', $value); - $this->_validateString('MetaValue', $value); + $this->validateNotNull('MetaValue', $value); + $this->validateString('MetaValue', $value); if ($this->data['meta_value'] === $value) { return; @@ -290,7 +290,7 @@ class BuildMetaBase extends Model $this->data['meta_value'] = $value; - $this->_setModified('meta_value'); + $this->setModified('meta_value'); } /** diff --git a/src/PHPCensor/Model/Base/ProjectBase.php b/src/PHPCensor/Model/Base/ProjectBase.php index e0eff10c..25c2c60e 100644 --- a/src/PHPCensor/Model/Base/ProjectBase.php +++ b/src/PHPCensor/Model/Base/ProjectBase.php @@ -353,8 +353,8 @@ class ProjectBase extends Model */ public function setId($value) { - $this->_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -362,7 +362,7 @@ class ProjectBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -373,8 +373,8 @@ class ProjectBase extends Model */ public function setTitle($value) { - $this->_validateNotNull('Title', $value); - $this->_validateString('Title', $value); + $this->validateNotNull('Title', $value); + $this->validateString('Title', $value); if ($this->data['title'] === $value) { return; @@ -382,7 +382,7 @@ class ProjectBase extends Model $this->data['title'] = $value; - $this->_setModified('title'); + $this->setModified('title'); } /** @@ -393,8 +393,8 @@ class ProjectBase extends Model */ public function setReference($value) { - $this->_validateNotNull('Reference', $value); - $this->_validateString('Reference', $value); + $this->validateNotNull('Reference', $value); + $this->validateString('Reference', $value); if ($this->data['reference'] === $value) { return; @@ -402,7 +402,7 @@ class ProjectBase extends Model $this->data['reference'] = $value; - $this->_setModified('reference'); + $this->setModified('reference'); } /** @@ -413,8 +413,8 @@ class ProjectBase extends Model */ public function setBranch($value) { - $this->_validateNotNull('Branch', $value); - $this->_validateString('Branch', $value); + $this->validateNotNull('Branch', $value); + $this->validateString('Branch', $value); if ($this->data['branch'] === $value) { return; @@ -422,7 +422,7 @@ class ProjectBase extends Model $this->data['branch'] = $value; - $this->_setModified('branch'); + $this->setModified('branch'); } /** @@ -432,7 +432,7 @@ class ProjectBase extends Model */ public function setSshPrivateKey($value) { - $this->_validateString('SshPrivateKey', $value); + $this->validateString('SshPrivateKey', $value); if ($this->data['ssh_private_key'] === $value) { return; @@ -440,7 +440,7 @@ class ProjectBase extends Model $this->data['ssh_private_key'] = $value; - $this->_setModified('ssh_private_key'); + $this->setModified('ssh_private_key'); } /** @@ -451,8 +451,8 @@ class ProjectBase extends Model */ public function setType($value) { - $this->_validateNotNull('Type', $value); - $this->_validateString('Type', $value); + $this->validateNotNull('Type', $value); + $this->validateString('Type', $value); if ($this->data['type'] === $value) { return; @@ -460,7 +460,7 @@ class ProjectBase extends Model $this->data['type'] = $value; - $this->_setModified('type'); + $this->setModified('type'); } /** @@ -470,7 +470,7 @@ class ProjectBase extends Model */ public function setAccessInformation($value) { - $this->_validateString('AccessInformation', $value); + $this->validateString('AccessInformation', $value); if ($this->data['access_information'] === $value) { return; @@ -478,7 +478,7 @@ class ProjectBase extends Model $this->data['access_information'] = $value; - $this->_setModified('access_information'); + $this->setModified('access_information'); } /** @@ -488,7 +488,7 @@ class ProjectBase extends Model */ public function setLastCommit($value) { - $this->_validateString('LastCommit', $value); + $this->validateString('LastCommit', $value); if ($this->data['last_commit'] === $value) { return; @@ -496,7 +496,7 @@ class ProjectBase extends Model $this->data['last_commit'] = $value; - $this->_setModified('last_commit'); + $this->setModified('last_commit'); } /** @@ -506,7 +506,7 @@ class ProjectBase extends Model */ public function setBuildConfig($value) { - $this->_validateString('BuildConfig', $value); + $this->validateString('BuildConfig', $value); if ($this->data['build_config'] === $value) { return; @@ -514,7 +514,7 @@ class ProjectBase extends Model $this->data['build_config'] = $value; - $this->_setModified('build_config'); + $this->setModified('build_config'); } /** @@ -524,7 +524,7 @@ class ProjectBase extends Model */ public function setSshPublicKey($value) { - $this->_validateString('SshPublicKey', $value); + $this->validateString('SshPublicKey', $value); if ($this->data['ssh_public_key'] === $value) { return; @@ -532,7 +532,7 @@ class ProjectBase extends Model $this->data['ssh_public_key'] = $value; - $this->_setModified('ssh_public_key'); + $this->setModified('ssh_public_key'); } /** @@ -543,8 +543,8 @@ class ProjectBase extends Model */ public function setAllowPublicStatus($value) { - $this->_validateNotNull('AllowPublicStatus', $value); - $this->_validateInt('AllowPublicStatus', $value); + $this->validateNotNull('AllowPublicStatus', $value); + $this->validateInt('AllowPublicStatus', $value); if ($this->data['allow_public_status'] === $value) { return; @@ -552,7 +552,7 @@ class ProjectBase extends Model $this->data['allow_public_status'] = $value; - $this->_setModified('allow_public_status'); + $this->setModified('allow_public_status'); } /** @@ -563,8 +563,8 @@ class ProjectBase extends Model */ public function setArchived($value) { - $this->_validateNotNull('Archived', $value); - $this->_validateInt('Archived', $value); + $this->validateNotNull('Archived', $value); + $this->validateInt('Archived', $value); if ($this->data['archived'] === $value) { return; @@ -572,7 +572,7 @@ class ProjectBase extends Model $this->data['archived'] = $value; - $this->_setModified('archived'); + $this->setModified('archived'); } /** @@ -583,8 +583,8 @@ class ProjectBase extends Model */ public function setGroupId($value) { - $this->_validateNotNull('GroupId', $value); - $this->_validateInt('GroupId', $value); + $this->validateNotNull('GroupId', $value); + $this->validateInt('GroupId', $value); if ($this->data['group_id'] === $value) { return; @@ -592,7 +592,7 @@ class ProjectBase extends Model $this->data['group_id'] = $value; - $this->_setModified('group_id'); + $this->setModified('group_id'); } /** diff --git a/src/PHPCensor/Model/Base/ProjectGroupBase.php b/src/PHPCensor/Model/Base/ProjectGroupBase.php index 35d4d719..93a9726c 100644 --- a/src/PHPCensor/Model/Base/ProjectGroupBase.php +++ b/src/PHPCensor/Model/Base/ProjectGroupBase.php @@ -119,8 +119,8 @@ class ProjectGroupBase extends Model */ public function setId($value) { - $this->_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -128,7 +128,7 @@ class ProjectGroupBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -139,8 +139,8 @@ class ProjectGroupBase extends Model */ public function setTitle($value) { - $this->_validateNotNull('Title', $value); - $this->_validateString('Title', $value); + $this->validateNotNull('Title', $value); + $this->validateString('Title', $value); if ($this->data['title'] === $value) { return; @@ -148,7 +148,7 @@ class ProjectGroupBase extends Model $this->data['title'] = $value; - $this->_setModified('title'); + $this->setModified('title'); } /** diff --git a/src/PHPCensor/Model/Base/UserBase.php b/src/PHPCensor/Model/Base/UserBase.php index 99aedeb2..ff2e03b5 100644 --- a/src/PHPCensor/Model/Base/UserBase.php +++ b/src/PHPCensor/Model/Base/UserBase.php @@ -221,8 +221,8 @@ class UserBase extends Model */ public function setId($value) { - $this->_validateNotNull('Id', $value); - $this->_validateInt('Id', $value); + $this->validateNotNull('Id', $value); + $this->validateInt('Id', $value); if ($this->data['id'] === $value) { return; @@ -230,7 +230,7 @@ class UserBase extends Model $this->data['id'] = $value; - $this->_setModified('id'); + $this->setModified('id'); } /** @@ -241,8 +241,8 @@ class UserBase extends Model */ public function setEmail($value) { - $this->_validateNotNull('Email', $value); - $this->_validateString('Email', $value); + $this->validateNotNull('Email', $value); + $this->validateString('Email', $value); if ($this->data['email'] === $value) { return; @@ -250,7 +250,7 @@ class UserBase extends Model $this->data['email'] = $value; - $this->_setModified('email'); + $this->setModified('email'); } /** @@ -261,8 +261,8 @@ class UserBase extends Model */ public function setHash($value) { - $this->_validateNotNull('Hash', $value); - $this->_validateString('Hash', $value); + $this->validateNotNull('Hash', $value); + $this->validateString('Hash', $value); if ($this->data['hash'] === $value) { return; @@ -270,7 +270,7 @@ class UserBase extends Model $this->data['hash'] = $value; - $this->_setModified('hash'); + $this->setModified('hash'); } /** @@ -281,8 +281,8 @@ class UserBase extends Model */ public function setIsAdmin($value) { - $this->_validateNotNull('IsAdmin', $value); - $this->_validateInt('IsAdmin', $value); + $this->validateNotNull('IsAdmin', $value); + $this->validateInt('IsAdmin', $value); if ($this->data['is_admin'] === $value) { return; @@ -290,7 +290,7 @@ class UserBase extends Model $this->data['is_admin'] = $value; - $this->_setModified('is_admin'); + $this->setModified('is_admin'); } /** @@ -301,8 +301,8 @@ class UserBase extends Model */ public function setName($value) { - $this->_validateNotNull('Name', $value); - $this->_validateString('Name', $value); + $this->validateNotNull('Name', $value); + $this->validateString('Name', $value); if ($this->data['name'] === $value) { return; @@ -310,7 +310,7 @@ class UserBase extends Model $this->data['name'] = $value; - $this->_setModified('name'); + $this->setModified('name'); } /** @@ -327,7 +327,7 @@ class UserBase extends Model $this->data['language'] = $value; - $this->_setModified('language'); + $this->setModified('language'); } /** @@ -344,7 +344,7 @@ class UserBase extends Model $this->data['per_page'] = $value; - $this->_setModified('per_page'); + $this->setModified('per_page'); } /** diff --git a/src/PHPCensor/Plugin/Codeception.php b/src/PHPCensor/Plugin/Codeception.php index 27f1e8c2..2d9bb310 100644 --- a/src/PHPCensor/Plugin/Codeception.php +++ b/src/PHPCensor/Plugin/Codeception.php @@ -13,9 +13,9 @@ use PHPCensor\Builder; use PHPCensor\Helper\Lang; use PHPCensor\Model\Build; use PHPCensor\Plugin\Util\TestResultParsers\Codeception as Parser; -use Psr\Log\LogLevel; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; +use Psr\Log\LogLevel; /** * Codeception Plugin - Enables full acceptance, unit, and functional testing. @@ -26,7 +26,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class Codeception extends Plugin implements ZeroConfigPlugin +class Codeception extends Plugin implements ZeroConfigPluginInterface { /** @var string */ protected $args = ''; @@ -142,7 +142,7 @@ class Codeception extends Plugin implements ZeroConfigPlugin $this->builder->log( 'Codeception XML path: '. $this->builder->buildPath . $this->path . 'report.xml', - Loglevel::DEBUG + LogLevel::DEBUG ); $xml = file_get_contents($this->builder->buildPath . $this->path . 'report.xml', false); diff --git a/src/PHPCensor/Plugin/Composer.php b/src/PHPCensor/Plugin/Composer.php index 91c9ebc5..3cfe0980 100644 --- a/src/PHPCensor/Plugin/Composer.php +++ b/src/PHPCensor/Plugin/Composer.php @@ -13,7 +13,7 @@ use PHPCensor; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * Composer Plugin - Provides access to Composer functionality. @@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class Composer extends Plugin implements ZeroConfigPlugin +class Composer extends Plugin implements ZeroConfigPluginInterface { protected $directory; protected $action; diff --git a/src/PHPCensor/Plugin/Email.php b/src/PHPCensor/Plugin/Email.php index d5a5e61b..f0d70d02 100644 --- a/src/PHPCensor/Plugin/Email.php +++ b/src/PHPCensor/Plugin/Email.php @@ -9,13 +9,8 @@ namespace PHPCensor\Plugin; -use b8\Config; -use b8\ViewRuntimeException; -use Exception; use b8\View; -use PHPCensor\Builder; use PHPCensor\Helper\Lang; -use PHPCensor\Model\Build; use PHPCensor\Helper\Email as EmailHelper; use Psr\Log\LogLevel; use PHPCensor\Plugin; @@ -57,7 +52,7 @@ class Email extends Plugin try { $view = $this->getMailTemplate(); - } catch (ViewRuntimeException $e) { + } catch (\RuntimeException $e) { $this->builder->log( sprintf('Unknown mail template "%s", falling back to default.', $this->options['template']), LogLevel::WARNING diff --git a/src/PHPCensor/Plugin/Env.php b/src/PHPCensor/Plugin/Env.php index 7363ae81..995aefc7 100644 --- a/src/PHPCensor/Plugin/Env.php +++ b/src/PHPCensor/Plugin/Env.php @@ -9,9 +9,7 @@ namespace PHPCensor\Plugin; -use PHPCensor\Builder; use PHPCensor\Helper\Lang; -use PHPCensor\Model\Build; use PHPCensor\Plugin; /** diff --git a/src/PHPCensor/Plugin/Git.php b/src/PHPCensor/Plugin/Git.php index 40a2fca8..8156c6b0 100644 --- a/src/PHPCensor/Plugin/Git.php +++ b/src/PHPCensor/Plugin/Git.php @@ -9,9 +9,7 @@ namespace PHPCensor\Plugin; -use PHPCensor\Builder; use PHPCensor\Helper\Lang; -use PHPCensor\Model\Build; use PHPCensor\Plugin; /** diff --git a/src/PHPCensor/Plugin/Phar.php b/src/PHPCensor/Plugin/Phar.php index 130f5275..af609810 100644 --- a/src/PHPCensor/Plugin/Phar.php +++ b/src/PHPCensor/Plugin/Phar.php @@ -2,7 +2,6 @@ namespace PHPCensor\Plugin; -use Exception; use PHPCensor\Builder; use PHPCensor\Helper\Lang; use PHPCensor\Model\Build; @@ -204,7 +203,7 @@ class Phar extends Plugin } $success = true; - } catch (Exception $e) { + } catch (\Exception $e) { $this->builder->log(Lang::get('phar_internal_error')); $this->builder->log($e->getMessage()); } diff --git a/src/PHPCensor/Plugin/PhpCodeSniffer.php b/src/PHPCensor/Plugin/PhpCodeSniffer.php index 771d8779..6c3b56e0 100644 --- a/src/PHPCensor/Plugin/PhpCodeSniffer.php +++ b/src/PHPCensor/Plugin/PhpCodeSniffer.php @@ -14,7 +14,7 @@ use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Model\BuildError; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Code Sniffer Plugin - Allows PHP Code Sniffer testing. @@ -23,7 +23,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpCodeSniffer extends Plugin implements ZeroConfigPlugin +class PhpCodeSniffer extends Plugin implements ZeroConfigPluginInterface { /** * @var array diff --git a/src/PHPCensor/Plugin/PhpCpd.php b/src/PHPCensor/Plugin/PhpCpd.php index 9b5cd3f7..84c0c00c 100644 --- a/src/PHPCensor/Plugin/PhpCpd.php +++ b/src/PHPCensor/Plugin/PhpCpd.php @@ -14,7 +14,7 @@ use PHPCensor\Helper\Lang; use PHPCensor\Model\Build; use PHPCensor\Model\BuildError; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Copy / Paste Detector - Allows PHP Copy / Paste Detector testing. @@ -23,7 +23,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpCpd extends Plugin implements ZeroConfigPlugin +class PhpCpd extends Plugin implements ZeroConfigPluginInterface { protected $directory; protected $args; diff --git a/src/PHPCensor/Plugin/PhpDocblockChecker.php b/src/PHPCensor/Plugin/PhpDocblockChecker.php index c82d82cf..74389c40 100644 --- a/src/PHPCensor/Plugin/PhpDocblockChecker.php +++ b/src/PHPCensor/Plugin/PhpDocblockChecker.php @@ -13,7 +13,7 @@ use PHPCensor; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Docblock Checker Plugin - Checks your PHP files for appropriate uses of Docblocks @@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpDocblockChecker extends Plugin implements ZeroConfigPlugin +class PhpDocblockChecker extends Plugin implements ZeroConfigPluginInterface { /** * @var string Based on the assumption the root may not hold the code to be diff --git a/src/PHPCensor/Plugin/PhpLoc.php b/src/PHPCensor/Plugin/PhpLoc.php index a827595b..8852fb73 100644 --- a/src/PHPCensor/Plugin/PhpLoc.php +++ b/src/PHPCensor/Plugin/PhpLoc.php @@ -13,7 +13,7 @@ use PHPCensor; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Loc - Allows PHP Copy / Lines of Code testing. @@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpLoc extends Plugin implements ZeroConfigPlugin +class PhpLoc extends Plugin implements ZeroConfigPluginInterface { /** * @var string diff --git a/src/PHPCensor/Plugin/PhpMessDetector.php b/src/PHPCensor/Plugin/PhpMessDetector.php index 721797b8..ac1d574c 100644 --- a/src/PHPCensor/Plugin/PhpMessDetector.php +++ b/src/PHPCensor/Plugin/PhpMessDetector.php @@ -13,7 +13,7 @@ use PHPCensor; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Mess Detector Plugin - Allows PHP Mess Detector testing. @@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpMessDetector extends Plugin implements ZeroConfigPlugin +class PhpMessDetector extends Plugin implements ZeroConfigPluginInterface { /** * @var array diff --git a/src/PHPCensor/Plugin/PhpParallelLint.php b/src/PHPCensor/Plugin/PhpParallelLint.php index b8604878..ddebd02e 100644 --- a/src/PHPCensor/Plugin/PhpParallelLint.php +++ b/src/PHPCensor/Plugin/PhpParallelLint.php @@ -12,7 +12,7 @@ namespace PHPCensor\Plugin; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * Php Parallel Lint Plugin - Provides access to PHP lint functionality. @@ -21,7 +21,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpParallelLint extends Plugin implements ZeroConfigPlugin +class PhpParallelLint extends Plugin implements ZeroConfigPluginInterface { /** * @var string diff --git a/src/PHPCensor/Plugin/PhpSpec.php b/src/PHPCensor/Plugin/PhpSpec.php index a95cdd4f..5d3918e9 100644 --- a/src/PHPCensor/Plugin/PhpSpec.php +++ b/src/PHPCensor/Plugin/PhpSpec.php @@ -10,8 +10,6 @@ namespace PHPCensor\Plugin; use PHPCensor; -use PHPCensor\Builder; -use PHPCensor\Model\Build; use PHPCensor\Plugin; /** diff --git a/src/PHPCensor/Plugin/PhpUnit.php b/src/PHPCensor/Plugin/PhpUnit.php index cc9c2991..49fabb06 100644 --- a/src/PHPCensor/Plugin/PhpUnit.php +++ b/src/PHPCensor/Plugin/PhpUnit.php @@ -17,7 +17,7 @@ use PHPCensor\Model\BuildError; use PHPCensor\Plugin\Option\PhpUnitOptions; use PHPCensor\Plugin\Util\PhpUnitResult; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * PHP Unit Plugin - A rewrite of the original PHP Unit plugin @@ -27,7 +27,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class PhpUnit extends Plugin implements ZeroConfigPlugin +class PhpUnit extends Plugin implements ZeroConfigPluginInterface { /** @var string[] Raw options from the PHPCI config file */ protected $options = array(); diff --git a/src/PHPCensor/Plugin/TechnicalDebt.php b/src/PHPCensor/Plugin/TechnicalDebt.php old mode 100755 new mode 100644 index 90349e79..5361584d --- a/src/PHPCensor/Plugin/TechnicalDebt.php +++ b/src/PHPCensor/Plugin/TechnicalDebt.php @@ -13,7 +13,7 @@ use PHPCensor; use PHPCensor\Builder; use PHPCensor\Model\Build; use PHPCensor\Plugin; -use PHPCensor\ZeroConfigPlugin; +use PHPCensor\ZeroConfigPluginInterface; /** * Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc. @@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin; * @package PHPCI * @subpackage Plugins */ -class TechnicalDebt extends Plugin implements ZeroConfigPlugin +class TechnicalDebt extends Plugin implements ZeroConfigPluginInterface { /** * @var array @@ -155,7 +155,7 @@ class TechnicalDebt extends Plugin implements ZeroConfigPlugin $skipFile = true; } - if ($skipFile == false) { + if ($skipFile === false) { $files[] = $file->getRealPath(); } } diff --git a/src/PHPCensor/ProcessControl/WindowsProcessControl.php b/src/PHPCensor/ProcessControl/WindowsProcessControl.php index 0790b72c..24b3868a 100644 --- a/src/PHPCensor/ProcessControl/WindowsProcessControl.php +++ b/src/PHPCensor/ProcessControl/WindowsProcessControl.php @@ -35,7 +35,6 @@ class WindowsProcessControl implements ProcessControlInterface */ public function kill($pid, $forcefully = false) { - $output = []; $result = 1; exec(sprintf("taskkill /t /pid %d %s 2>nul:", $pid, $forcefully ? '/f' : '')); diff --git a/src/PHPCensor/Service/UserService.php b/src/PHPCensor/Service/UserService.php index 3b6bb7a6..bf0688e8 100644 --- a/src/PHPCensor/Service/UserService.php +++ b/src/PHPCensor/Service/UserService.php @@ -9,7 +9,6 @@ namespace PHPCensor\Service; -use PHPCensor\Helper\Lang; use PHPCensor\Model\User; use PHPCensor\Store\UserStore; diff --git a/src/PHPCensor/ZeroConfigPlugin.php b/src/PHPCensor/ZeroConfigPluginInterface.php similarity index 92% rename from src/PHPCensor/ZeroConfigPlugin.php rename to src/PHPCensor/ZeroConfigPluginInterface.php index d2525a6d..19007e17 100644 --- a/src/PHPCensor/ZeroConfigPlugin.php +++ b/src/PHPCensor/ZeroConfigPluginInterface.php @@ -15,7 +15,7 @@ use PHPCensor\Model\Build; * PHPCI Plugin Interface - Used by all build plugins. * @author Dan Cryer */ -interface ZeroConfigPlugin +interface ZeroConfigPluginInterface { public static function canExecute($stage, Builder $builder, Build $build); } diff --git a/tests/B8Framework/ViewTest.php b/tests/B8Framework/ViewTest.php index 5794ec58..bb9265fe 100755 --- a/tests/B8Framework/ViewTest.php +++ b/tests/B8Framework/ViewTest.php @@ -31,19 +31,6 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->assertTrue($view->render() == 'Hello World'); } - public function testFormatViewHelper() - { - $view = new View('format', __DIR__ . '/data/view/'); - $view->number = 1000000.25; - $view->symbol = true; - - $this->assertTrue($view->render() == '£1,000,000.25'); - - $view->number = 1024; - $view->symbol = false; - $this->assertTrue($view->render() == '1,024.00'); - } - /** * @expectedException \Exception */ @@ -115,12 +102,6 @@ class ViewTest extends \PHPUnit_Framework_TestCase $view = new Template('Hello{ifnot who} World{/ifnot}'); $view->who = true; $this->assertTrue($view->render() == 'Hello'); - - $view = new Template('Hello {if Format:not_present}World{/if}'); - $this->assertTrue($view->render() == 'Hello '); - - $view = new Template('Hello {ifnot Format:not_present}World{/ifnot}'); - $this->assertTrue($view->render() == 'Hello World'); } public function testUserViewLoop() diff --git a/tests/B8Framework/data/view/format.phtml b/tests/B8Framework/data/view/format.phtml deleted file mode 100755 index c87199a6..00000000 --- a/tests/B8Framework/data/view/format.phtml +++ /dev/null @@ -1 +0,0 @@ -Format()->Currency($number, $symbol); ?>