diff --git a/src/Core/Base/Timestamp.php b/src/Core/Base/Timestamp.php index 96cd7685ad..2ed1561eea 100644 --- a/src/Core/Base/Timestamp.php +++ b/src/Core/Base/Timestamp.php @@ -64,19 +64,6 @@ public function __construct($dateTime, \DateTimeZone $zone=null) } - private function getDefaultTimeZone() - { - try { - $defaultTimeZoneName = date_default_timezone_get(); - return new \DateTimeZone($defaultTimeZoneName); - } catch(\Exception $e) { - throw new WrongStateException( - "strange default time zone given - '{$defaultTimeZoneName}'!". - 'Use date_default_timezone_set() for set valid default time zone.' - ); - } - } - public function toTime($timeDelimiter = ':', $secondDelimiter = '.') { return diff --git a/src/Core/Cache/AggregateCache.php b/src/Core/Cache/AggregateCache.php index 00e74c3bac..2ad5b517e6 100644 --- a/src/Core/Cache/AggregateCache.php +++ b/src/Core/Cache/AggregateCache.php @@ -73,7 +73,7 @@ protected function guessLabel($key) } // init by $key, randomness will be restored later - mt_srand(hexdec(substr(md5($key), 3, 7))); + mt_srand(intval(hexdec(substr(md5($key), 3, 7)))); $zeroDistances = array(); $weights = array(); diff --git a/src/Core/Form/FormUtils.php b/src/Core/Form/FormUtils.php index 5d95f82f38..e18f8970fc 100644 --- a/src/Core/Form/FormUtils.php +++ b/src/Core/Form/FormUtils.php @@ -34,7 +34,7 @@ final class FormUtils extends StaticFactory $proto = $object->proto(); foreach (array_keys($proto->getExpandedPropertyList()) as $name) { - if ($form->primitiveExists($name)) { + if ($form->exists($name)) { $proto->importPrimitive( $name, $form, diff --git a/src/Core/Form/MappedForm.php b/src/Core/Form/MappedForm.php index 7cb1a54935..7fd62b515b 100644 --- a/src/Core/Form/MappedForm.php +++ b/src/Core/Form/MappedForm.php @@ -144,7 +144,7 @@ public function export(RequestType $type) **/ private function checkExistence($name) { - if (!$this->form->primitiveExists($name)) + if (!$this->form->exists($name)) throw new MissingElementException( "there is no '{$name}' primitive" ); diff --git a/src/Core/Form/Primitives/DateRangeList.php b/src/Core/Form/Primitives/DateRangeList.php index 1e9435c7e7..835420ac5e 100644 --- a/src/Core/Form/Primitives/DateRangeList.php +++ b/src/Core/Form/Primitives/DateRangeList.php @@ -123,13 +123,9 @@ public static function makeRange($string) if ($start || $finish) { - $range = new DateRange(); - - $range = + return DateRange::create()-> - lazySet($start, $finish); - - return $range; + lazySet($start, $finish); } elseif (trim($string) == '-') return DateRange::create(); diff --git a/src/Core/Form/Primitives/PrimitiveDateRange.php b/src/Core/Form/Primitives/PrimitiveDateRange.php index 0b2884a66e..a147bf2c8f 100644 --- a/src/Core/Form/Primitives/PrimitiveDateRange.php +++ b/src/Core/Form/Primitives/PrimitiveDateRange.php @@ -82,7 +82,6 @@ public function importValue($value) public function import($scope) { if (parent::import($scope)) { - $listName = $this->getObjectName().'List'; try { $range = $this->makeRange($scope[$this->name]); } catch (WrongArgumentException $e) { diff --git a/src/Core/Form/Primitives/TimeList.php b/src/Core/Form/Primitives/TimeList.php index def6ac9e49..e3b2c4eaec 100644 --- a/src/Core/Form/Primitives/TimeList.php +++ b/src/Core/Form/Primitives/TimeList.php @@ -87,7 +87,7 @@ public static function stringToTimeList($string) { $list = array(); - $times = split("([,; \n]+)", $string); + $times = preg_split("([,; \n]+)", $string); for ($i = 0, $size = count($times); $i < $size; ++$i) { $time = mb_ereg_replace('[^0-9:]', ':', $times[$i]); diff --git a/src/Main/Charts/Google/GoogleChart.php b/src/Main/Charts/Google/GoogleChart.php index 26e661bca2..58fd10dfe7 100644 --- a/src/Main/Charts/Google/GoogleChart.php +++ b/src/Main/Charts/Google/GoogleChart.php @@ -160,7 +160,7 @@ public function toString() $url = self::BASE_URL; Assert::isNotNull($this->type); - $parameters[] = $this->type->toString(); + $parameters = array($this->type->toString()); Assert::isNotNull($this->size); $parameters[] = $this->size->toString(); diff --git a/src/Main/Charts/Google/GoogleChartLabelStyle.php b/src/Main/Charts/Google/GoogleChartLabelStyle.php index f113adecbb..2764affab0 100644 --- a/src/Main/Charts/Google/GoogleChartLabelStyle.php +++ b/src/Main/Charts/Google/GoogleChartLabelStyle.php @@ -49,8 +49,6 @@ public function toString() Assert::isNotEmptyArray($this->styles); - $i = 0; - foreach ($this->styles as $style) $queryString .= $style->toString().'|'; diff --git a/src/Main/Charts/Google/GoogleChartSolidFillCollection.php b/src/Main/Charts/Google/GoogleChartSolidFillCollection.php index 3445631132..ebdec62dab 100644 --- a/src/Main/Charts/Google/GoogleChartSolidFillCollection.php +++ b/src/Main/Charts/Google/GoogleChartSolidFillCollection.php @@ -46,6 +46,7 @@ public function toString() { $fillerString = GoogleChartSolidFill::getParamName().'='; + $filters = array(); foreach ($this->fillers as $filler) $fillers[] = $filler->toString(); diff --git a/src/Main/Criteria/Criteria.php b/src/Main/Criteria/Criteria.php index 3990d43d99..7f49622378 100644 --- a/src/Main/Criteria/Criteria.php +++ b/src/Main/Criteria/Criteria.php @@ -664,16 +664,5 @@ private function joinProperties( } } } - - /** - * @return AbstractProtoClass - **/ - private function getProto() - { - return - call_user_func( - array($this->checkAndGetDao()->getObjectName(), 'proto') - ); - } } ?> diff --git a/src/Main/DAO/ProtoDAO.php b/src/Main/DAO/ProtoDAO.php index 7dc1eb19e9..0e5015ee49 100644 --- a/src/Main/DAO/ProtoDAO.php +++ b/src/Main/DAO/ProtoDAO.php @@ -77,7 +77,6 @@ public function fetchCollections( $propertyPath = $info['propertyPath']; $property = $propertyPath->getFinalProperty(); - $proto = $propertyPath->getFinalProto(); $dao = $propertyPath->getFinalDao(); $selfName = $this->getObjectName(); diff --git a/src/Main/DAO/Uncacher/UncacherTaggableDaoWorker.php b/src/Main/DAO/Uncacher/UncacherTaggableDaoWorker.php index ec80a0b9e9..a7f1df8f66 100644 --- a/src/Main/DAO/Uncacher/UncacherTaggableDaoWorker.php +++ b/src/Main/DAO/Uncacher/UncacherTaggableDaoWorker.php @@ -62,7 +62,7 @@ public function uncache() $worker->expireTags($tags); foreach ($idKeys as $key) - Cache::me()->mark($className)->delete($idKey); + Cache::me()->mark($className)->delete($key); ClassUtils::callStaticMethod("$className::dao")->uncacheLists(); } diff --git a/src/Main/DAO/Worker/SmartDaoWorker.php b/src/Main/DAO/Worker/SmartDaoWorker.php index 06d5cc4bba..0afe7ec3a3 100644 --- a/src/Main/DAO/Worker/SmartDaoWorker.php +++ b/src/Main/DAO/Worker/SmartDaoWorker.php @@ -49,8 +49,6 @@ protected function cacheByQuery( $expires = Cache::EXPIRES_FOREVER ) { - $queryId = $query->getId(); - $semKey = $this->keyToInt($this->indexKey); $key = $this->makeQueryKey($query, self::SUFFIX_QUERY); diff --git a/src/Main/EntityProto/EntityProto.php b/src/Main/EntityProto/EntityProto.php index 6ae9f00db2..9a312e7e6d 100644 --- a/src/Main/EntityProto/EntityProto.php +++ b/src/Main/EntityProto/EntityProto.php @@ -118,8 +118,6 @@ final public function validateSelf( ? $previousGetter->get($id) : null; - $childResult = true; - if ( $child && !$proto->validate( diff --git a/src/Main/Markup/Html/HtmlTokenizer.php b/src/Main/Markup/Html/HtmlTokenizer.php index fb308fb2d5..c5914209ea 100644 --- a/src/Main/Markup/Html/HtmlTokenizer.php +++ b/src/Main/Markup/Html/HtmlTokenizer.php @@ -284,28 +284,6 @@ private function reset() return $this; } - /** - * @return HtmlTokenizer - **/ - private function skip($count) - { - for ($i = 0; $i < $count; ++$i) - $this->getNextChar(); - - return $this; - } - - private function lookAhead($count) - { - $this->stream->mark(); - - $result = $this->stream->read($count); - - $this->stream->reset(); - - return $result; - } - private function skipString($string, $skipSpaces = false) { $this->mark(); diff --git a/src/Main/Math/MathUtils.php b/src/Main/Math/MathUtils.php index 45106e03fb..95d6fe08a4 100644 --- a/src/Main/Math/MathUtils.php +++ b/src/Main/Math/MathUtils.php @@ -49,6 +49,7 @@ public static function makeCartesianProduct( $size *= sizeof($array); $keys = array_keys($arrays); + $tmpArrays = array(); foreach ($keys as $key) $tmpArrays[] = $arrays[$key]; @@ -86,6 +87,7 @@ public static function applyFunctorToCartesianProduct( $size *= sizeof($array); $keys = array_keys($arrays); + $tmpArrays = array(); foreach ($keys as $key) $tmpArrays[] = $arrays[$key]; diff --git a/src/Main/Util/ClassUtils.php b/src/Main/Util/ClassUtils.php index 4f24ad8c19..599987ec24 100644 --- a/src/Main/Util/ClassUtils.php +++ b/src/Main/Util/ClassUtils.php @@ -137,23 +137,7 @@ public static function isSameClassNames($left, $right) /// to avoid dependency on SPL's class_implements public static function isClassImplements($what) { - static $classImplements = null; - - if (!$classImplements) { - if (!function_exists('class_implements')) { - $classImplements = create_function( - '$what', - ' - $info = new \ReflectionClass($what); - return $info->getInterfaceNames(); - ' - ); - } else { - $classImplements = 'class_implements'; - } - } - - return $classImplements($what, true); + return class_implements($what, true); } public static function isInstanceOf($object, $class) diff --git a/src/Meta/Console/MetaOutput.php b/src/Meta/Console/MetaOutput.php index 52793e0e9e..5ff6ce3f30 100644 --- a/src/Meta/Console/MetaOutput.php +++ b/src/Meta/Console/MetaOutput.php @@ -94,7 +94,7 @@ public function warningLine($text) **/ public function error($text, $bold = false) { - return $this->errorText($text, ConsoleMode::FG_RED, $bold); + return $this->errorText($text); } /** @@ -102,7 +102,7 @@ public function error($text, $bold = false) **/ public function errorLine($text, $bold = false) { - return $this->errorTextLine($text, ConsoleMode::FG_RED, $bold); + return $this->errorTextLine($text); } /** @@ -162,7 +162,7 @@ private function defaultTextLine($text, $color, $bold) /** * @return MetaOutput **/ - private function errorText($text, $color, $bold) + private function errorText($text) { if ($this->out instanceof ColoredTextOutput) $text = $this->out->wrapString($text); @@ -175,7 +175,7 @@ private function errorText($text, $color, $bold) /** * @return MetaOutput **/ - private function errorTextLine($text, $color, $bold) + private function errorTextLine($text) { if ($this->out instanceof ColoredTextOutput) $text = $this->out->wrapString($text); diff --git a/src/Meta/Entity/MetaClassProperty.php b/src/Meta/Entity/MetaClassProperty.php index d356c0b31a..f257189cd7 100644 --- a/src/Meta/Entity/MetaClassProperty.php +++ b/src/Meta/Entity/MetaClassProperty.php @@ -546,10 +546,5 @@ private function buildColumn($columnName) return $column; } - - private function toVarName($name) - { - return strtolower($name[0]).substr($name, 1); - } } ?> \ No newline at end of file diff --git a/src/Meta/Entity/MetaConfiguration.php b/src/Meta/Entity/MetaConfiguration.php index 6a6610f822..c0e7b3d91a 100644 --- a/src/Meta/Entity/MetaConfiguration.php +++ b/src/Meta/Entity/MetaConfiguration.php @@ -430,7 +430,6 @@ public function buildContainers() && ($property->getRelationId() != MetaRelation::ONE_TO_ONE) ) { $relation = $class->getName() . ucfirst($property->getName()) . 'DAO'; - $userFile1 = NamespaceUtils::getDAODir($class) . DIRECTORY_SEPARATOR . $relation . EXT_CLASS; $userFile = ONPHP_META_DAO_DIR .$class->getName().ucfirst($property->getName())