Skip to content

Commit

Permalink
Using stubs to better analyze some components (#18)
Browse files Browse the repository at this point in the history
* Using stubs to better analyze some components

* Trying the no-api flag to fix travis + github issue

* Adding some more missing extensions (that travis doesn't have installed)

* a few return type changes for possible false value from hash functions
  • Loading branch information
jaydiablo committed Apr 9, 2018
1 parent bcdd00c commit ac17e35
Show file tree
Hide file tree
Showing 53 changed files with 398 additions and 234 deletions.
33 changes: 26 additions & 7 deletions README.md
@@ -1,3 +1,29 @@
Zend Framework 1
================
[![Build Status](https://travis-ci.org/diablomedia/zf1.svg?branch=version-test-fix)](https://travis-ci.org/diablomedia/zf1)
[![codecov](https://codecov.io/gh/diablomedia/zf1/branch/master/graph/badge.svg)](https://codecov.io/gh/diablomedia/zf1)
[![Latest Stable Version](https://poser.pugx.org/diablomedia/zendframework1/v/stable)](https://packagist.org/packages/diablomedia/zendframework1)
[![Total Downloads](https://poser.pugx.org/diablomedia/zendframework1/downloads)](https://packagist.org/packages/diablomedia/zendframework1)
[![License](https://poser.pugx.org/diablomedia/zendframework1/license)](https://packagist.org/packages/diablomedia/zendframework1)

This is a fork of Zend Framework 1 that we'll maintain as long as we're using it, mainly just to keep it working on new versions of PHP as they're released.

This fork is based on the final release of the original project (version 1.12.20), and releases will follow [semantic versioning](https://semver.org/). The first release of this fork is version 2.0.0.

## Release Highlights

### 3.0.0

* Minimum PHP version set to 7.0
* PHPUnit upgraded to 6.0

### 2.0.0

* Renamed to our organization in Composer
* Minimum PHP version set to 5.6

## The following is the original README contents from upstream:

![Logo](http://framework.zend.com/images/logos/ZendFramework-logo.png)

> ## End-of-Life occurs 28 Sep 2016
Expand All @@ -9,13 +35,6 @@
>
> - https://framework.zend.com/blog/2016-06-28-zf1-eol.html
---

[![Build Status](https://travis-ci.org/diablomedia/zf1.svg?branch=version-test-fix)](https://travis-ci.org/diablomedia/zf1)
[![codecov](https://codecov.io/gh/diablomedia/zf1/branch/master/graph/badge.svg)](https://codecov.io/gh/diablomedia/zf1)
[![Latest Stable Version](https://poser.pugx.org/diablomedia/zendframework1/v/stable)](https://packagist.org/packages/diablomedia/zendframework1)
[![Total Downloads](https://poser.pugx.org/diablomedia/zendframework1/downloads)](https://packagist.org/packages/diablomedia/zendframework1)
[![License](https://poser.pugx.org/diablomedia/zendframework1/license)](https://packagist.org/packages/diablomedia/zendframework1)

RELEASE INFORMATION
===================
Expand Down
13 changes: 12 additions & 1 deletion composer.json
Expand Up @@ -8,6 +8,8 @@
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.0.0"
},
Expand All @@ -32,11 +34,20 @@
"config": {
"bin-dir": "bin"
},
"repositories": [
{
"type": "vcs",
"no-api": true,
"url": "https://github.com/diablomedia/phpstorm-stubs"
}
],
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpunit/dbunit": "^3.0.2",
"phpunit/phpcov": "^4.0",
"phpstan/phpstan": "^0.9.2"
"phpstan/phpstan": "^0.9.2",
"jetbrains/phpstorm-stubs": "dev-phpstan",
"pear/archive_tar": "^1.4"
},
"archive": {
"exclude": ["/demos", "/documentation", "/tests"]
Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Amf/Value/MessageBody.php
Expand Up @@ -107,7 +107,7 @@ public function getTargetUri()
* Set target Uri
*
* @param string $targetUri
* @return Zend_Amf_Value_MessageBody
* @return $this
*/
public function setTargetUri($targetUri)
{
Expand All @@ -132,7 +132,7 @@ public function getResponseUri()
* Set response Uri
*
* @param string $responseUri
* @return Zend_Amf_Value_MessageBody
* @return $this
*/
public function setResponseUri($responseUri)
{
Expand All @@ -157,7 +157,7 @@ public function getData()
* Set response data
*
* @param mixed $data
* @return Zend_Amf_Value_MessageBody
* @return $this
*/
public function setData($data)
{
Expand All @@ -169,7 +169,7 @@ public function setData($data)
* Set reply method
*
* @param string $methodName
* @return Zend_Amf_Value_MessageBody
* @return $this
*/
public function setReplyMethod($methodName)
{
Expand Down
1 change: 1 addition & 0 deletions library/Zend/Cache/Backend/Apc.php
Expand Up @@ -98,6 +98,7 @@ public function test($id)
public function save($data, $id, $tags = array(), $specificLifetime = false)
{
$lifetime = $this->getLifetime($specificLifetime);
/** @var bool $result Won't return an array if $id is a string */
$result = apc_store($id, array($data, time(), $lifetime), $lifetime);
if (count($tags) > 0) {
$this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
Expand Down
10 changes: 6 additions & 4 deletions library/Zend/Cache/Backend/Sqlite.php
Expand Up @@ -53,9 +53,9 @@ class Zend_Cache_Backend_Sqlite extends Zend_Cache_Backend implements Zend_Cache
/**
* DB ressource
*
* @var mixed $_db
* @var resource $_db
*/
private $_db = null;
private $_db;

/**
* Boolean to store if the structure has benn checked or not
Expand Down Expand Up @@ -481,10 +481,12 @@ private function _getConnection()
if (is_resource($this->_db)) {
return $this->_db;
} else {
$this->_db = @sqlite_open($this->_options['cache_db_complete_path']);
if (!(is_resource($this->_db))) {
$db = @sqlite_open($this->_options['cache_db_complete_path']);
if (!(is_resource($db))) {
Zend_Cache::throwException("Impossible to open " . $this->_options['cache_db_complete_path'] . " cache DB file");
}
$this->_db = $db;

return $this->_db;
}
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Cloud/QueueService/Adapter/WindowsAzure.php
Expand Up @@ -87,10 +87,10 @@ public function __construct($options = array())
$host = $options[self::HOST];
}
if (! isset($options[self::ACCOUNT_NAME])) {
throw new Zend_Cloud_Storage_Exception('No Windows Azure account name provided.');
throw new Zend_Cloud_QueueService_Exception('No Windows Azure account name provided.');
}
if (! isset($options[self::ACCOUNT_KEY])) {
throw new Zend_Cloud_Storage_Exception('No Windows Azure account key provided.');
throw new Zend_Cloud_QueueService_Exception('No Windows Azure account key provided.');
}
try {
// TODO: support $usePathStyleUri and $retryPolicy
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Action/Helper/Abstract.php
Expand Up @@ -32,7 +32,7 @@ abstract class Zend_Controller_Action_Helper_Abstract
/**
* $_actionController
*
* @var Zend_Controller_Action $_actionController
* @var Zend_Controller_Action|null $_actionController
*/
protected $_actionController = null;

Expand All @@ -56,7 +56,7 @@ public function setActionController(Zend_Controller_Action $actionController = n
/**
* Retrieve current action controller
*
* @return Zend_Controller_Action
* @return Zend_Controller_Action|null
*/
public function getActionController()
{
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Action/HelperBroker.php
Expand Up @@ -37,7 +37,7 @@ class Zend_Controller_Action_HelperBroker
protected $_actionController;

/**
* @var Zend_Loader_PluginLoader_Interface
* @var Zend_Loader_PluginLoader_Interface|null
*/
protected static $_pluginLoader;

Expand All @@ -51,7 +51,7 @@ class Zend_Controller_Action_HelperBroker
/**
* Set PluginLoader for use with broker
*
* @param Zend_Loader_PluginLoader_Interface $loader
* @param Zend_Loader_PluginLoader_Interface|null $loader
* @return void
*/
public static function setPluginLoader($loader)
Expand Down
20 changes: 10 additions & 10 deletions library/Zend/Controller/Request/Http.php
Expand Up @@ -236,7 +236,7 @@ public function has($key)
*
* @param string|array $spec
* @param null|mixed $value
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setQuery($spec, $value = null)
{
Expand Down Expand Up @@ -277,7 +277,7 @@ public function getQuery($key = null, $default = null)
*
* @param string|array $spec
* @param null|mixed $value
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setPost($spec, $value = null)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ public function getEnv($key = null, $default = null)
* $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] + $_SERVER['QUERY_STRING'].
*
* @param string $requestUri
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setRequestUri($requestUri = null)
{
Expand Down Expand Up @@ -458,7 +458,7 @@ public function getRequestUri()
* ORIG_SCRIPT_NAME in its determination.
*
* @param mixed $baseUrl
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setBaseUrl($baseUrl = null)
{
Expand Down Expand Up @@ -552,7 +552,7 @@ public function getBaseUrl($raw = false)
* Set the base path for the URL
*
* @param string|null $basePath
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setBasePath($basePath = null)
{
Expand Down Expand Up @@ -601,7 +601,7 @@ public function getBasePath()
* Set the PATH_INFO string
*
* @param string|null $pathInfo
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setPathInfo($pathInfo = null)
{
Expand Down Expand Up @@ -661,7 +661,7 @@ public function getPathInfo()
* Can be empty array, or contain one or more of '_GET' or '_POST'.
*
* @param array $paramSources
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setParamSources(array $paramSources = array())
{
Expand All @@ -687,7 +687,7 @@ public function getParamSources()
*
* @param mixed $key
* @param mixed $value
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setParam($key, $value)
{
Expand Down Expand Up @@ -760,7 +760,7 @@ public function getParams()
* using the keys specified in the array.
*
* @param array $params
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setParams(array $params)
{
Expand All @@ -778,7 +778,7 @@ public function setParams(array $params)
*
* @param string $name
* @param string $target
* @return Zend_Controller_Request_Http
* @return $this
*/
public function setAlias($name, $target)
{
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Crypt.php
Expand Up @@ -135,7 +135,7 @@ protected static function _digestHash($algorithm, $data, $binaryOutput)
* @param string $algorithm
* @param string $data
* @param bool $binaryOutput
* @return string
* @return string|false
*/
protected static function _digestMhash($algorithm, $data, $binaryOutput)
{
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Crypt/Hmac.php
Expand Up @@ -81,7 +81,7 @@ class Zend_Crypt_Hmac extends Zend_Crypt
* @param string $data
* @param string $output
* @throws Zend_Crypt_Hmac_Exception
* @return string
* @return string|false
*/
public static function compute($key, $hash, $data, $output = self::STRING)
{
Expand Down Expand Up @@ -134,7 +134,7 @@ protected static function _setHashAlgorithm($hash)
* @param string $data
* @param string $output
* @param bool $internal Option to not use hash() functions for testing
* @return string
* @return string|false
*/
protected static function _hash($data, $output = self::STRING, $internal = false)
{
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Crypt/Math/BigInteger/Gmp.php
Expand Up @@ -78,7 +78,7 @@ public function subtract($left_operand, $right_operand)
*
* @param resource $left_operand
* @param resource $right_operand
* @return int
* @return string
*/
public function compare($left_operand, $right_operand)
{
Expand Down
22 changes: 11 additions & 11 deletions library/Zend/Date.php
Expand Up @@ -1277,7 +1277,7 @@ private function _assign($calc, $date, $comp = 0, $dst = false)
* @param string $calc Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set'
* @param string|integer|array|Zend_Date $date Date or datepart to calculate with
* @param string $part Part of the date to calculate, if null the timestamp is used
* @param string|Zend_Locale $locale Locale for parsing input
* @param string|Zend_Locale|null $locale Locale for parsing input
* @return integer|string|Zend_Date new timestamp
* @throws Zend_Date_Exception
*/
Expand Down Expand Up @@ -2705,7 +2705,7 @@ public function getTime($locale = null)
* @param string $calc Calculation to make
* @param string|integer|array|Zend_Date $time Time to calculate with, if null the actual time is taken
* @param string $format Timeformat for parsing input
* @param string|Zend_Locale $locale Locale for parsing input
* @param string|Zend_Locale|null $locale Locale for parsing input
* @return integer|$this new time
* @throws Zend_Date_Exception
*/
Expand Down Expand Up @@ -2865,7 +2865,7 @@ public function getDate($locale = null)
* @param string $calc Calculation to make
* @param string|integer|array|Zend_Date $date Date to calculate with, if null the actual date is taken
* @param string $format Date format for parsing
* @param string|Zend_Locale $locale Locale for parsing input
* @param string|Zend_Locale|null $locale Locale for parsing input
* @return integer|$this new date
* @throws Zend_Date_Exception
*/
Expand Down Expand Up @@ -3438,7 +3438,7 @@ private function _calcdetail($calc, $date, $type, $locale)
* @param string|integer|Zend_Date|array $value Datevalue to calculate with, if null the actual value is taken
* @param string $type
* @param string $parameter
* @param string|Zend_Locale $locale Locale for parsing input
* @param string|Zend_Locale|null $locale Locale for parsing input
* @throws Zend_Date_Exception
* @return integer|$this new date
*/
Expand Down Expand Up @@ -3584,7 +3584,7 @@ public function getMonth($locale = null)
*
* @param string $calc Calculation to make
* @param string|integer|array|Zend_Date $month Month to calculate with, if null the actual month is taken
* @param string|Zend_Locale $locale Locale for parsing input
* @param string|Zend_Locale|null $locale Locale for parsing input
* @return integer|$this new time
* @throws Zend_Date_Exception
*/
Expand Down Expand Up @@ -3735,9 +3735,9 @@ public function getDay($locale = null)
/**
* Returns the calculated day
*
* @param string $calc Type of calculation to make
* @param Zend_Date $day Day to calculate, when null the actual day is calculated
* @param Zend_Locale $locale Locale for parsing input
* @param string $calc Type of calculation to make
* @param Zend_Date $day Day to calculate, when null the actual day is calculated
* @param Zend_Locale|null $locale Locale for parsing input
* @throws Zend_Date_Exception
* @return $this|integer
*/
Expand Down Expand Up @@ -3884,9 +3884,9 @@ public function getWeekday($locale = null)
/**
* Returns the calculated weekday
*
* @param string $calc Type of calculation to make
* @param Zend_Date $weekday Weekday to calculate, when null the actual weekday is calculated
* @param Zend_Locale $locale Locale for parsing input
* @param string $calc Type of calculation to make
* @param Zend_Date $weekday Weekday to calculate, when null the actual weekday is calculated
* @param Zend_Locale|null $locale Locale for parsing input
* @return $this|integer
* @throws Zend_Date_Exception
*/
Expand Down

0 comments on commit ac17e35

Please sign in to comment.