Run phan over code base

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
pull/5776/head
Lukas Reschke 7 years ago
parent 0ee83ac56b
commit d8ec399454
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
  1. 9
      .drone.yml
  2. 8
      apps/files_external/lib/Lib/Storage/Swift.php
  3. 2
      apps/files_sharing/lib/Controller/ShareAPIController.php
  4. 1
      apps/files_sharing/lib/Controller/ShareesAPIController.php
  5. 3
      apps/sharebymail/lib/ShareByMailProvider.php
  6. 155
      build/.phan/config.php
  7. 82
      build/.phan/stubs/APCIterator.php
  8. 82
      build/.phan/stubs/APCUIterator.php
  9. 318
      build/.phan/stubs/apc.php
  10. 235
      build/.phan/stubs/apcu.php
  11. 1257
      build/.phan/stubs/memcached.php
  12. 217
      build/.phan/stubs/xcache.php
  13. 3
      composer.json
  14. 4
      core/routes.php
  15. 2
      lib/private/Diagnostics/QueryLogger.php
  16. 2
      lib/private/Files/View.php
  17. 2
      lib/private/Share20/Manager.php
  18. 2
      lib/private/Share20/ProviderFactory.php

@ -43,6 +43,14 @@ pipeline:
when:
matrix:
TESTS: syntax-php7.1
phan:
image: nextcloudci/php7.1:php7.0-13
commands:
- composer install
- ./lib/composer/etsy/phan/phan -k build/.phan/config.php
when:
matrix:
TESTS: phan
litmus-v1:
image: nextcloudci/litmus-php7.0:litmus-php7.0-4
commands:
@ -574,6 +582,7 @@ matrix:
- TESTS: syntax-php5.6
- TESTS: syntax-php7.0
- TESTS: syntax-php7.1
- TESTS: phan
- TESTS: litmus-v1
- TESTS: litmus-v2
- TESTS: caldavtester-old-endpoint

@ -118,7 +118,7 @@ class Swift extends \OC\Files\Storage\Common {
* that one will be returned.
*
* @param string $path
* @return \OpenCloud\OpenStack\ObjectStorage\Resource\DataObject|bool object
* @return \OpenCloud\ObjectStore\Resource\DataObject|bool object
* or false if the object did not exist
*/
private function fetchObject($path) {
@ -382,9 +382,9 @@ class Swift extends \OC\Files\Storage\Common {
try {
$c = $this->getContainer();
$streamFactory = new \Guzzle\Stream\PhpStreamRequestFactory();
$streamInterface = $streamFactory->fromRequest(
$c->getClient()
->get($c->getUrl($path)));
/** @var \OpenCloud\Common\Http\Client $client */
$client = $c->getClient();
$streamInterface = $streamFactory->fromRequest($client->get($c->getUrl($path)));
$streamInterface->rewind();
$stream = $streamInterface->getStream();
stream_context_set_option($stream, 'swift','content', $streamInterface);

@ -308,6 +308,8 @@ class ShareAPIController extends OCSController {
* @throws OCSForbiddenException
* @throws OCSBadRequestException
* @throws OCSException
*
* @suppress PhanUndeclaredClassMethod
*/
public function createShare(
$path = null,

@ -299,6 +299,7 @@ class ShareesAPIController extends OCSController {
/**
* @param string $search
* @suppress PhanUndeclaredClassMethod
*/
protected function getCircles($search) {
$this->result['circles'] = $this->result['exact']['circles'] = [];

@ -24,6 +24,7 @@ namespace OCA\ShareByMail;
use OC\CapabilitiesManager;
use OC\HintException;
use OC\Share20\Exception\InvalidShare;
use OC\User\NoUserException;
use OCA\ShareByMail\Settings\SettingsManager;
use OCP\Activity\IManager;
use OCP\DB\QueryBuilder\IQueryBuilder;
@ -923,7 +924,7 @@ class ShareByMailProvider implements IShareProvider {
private function getNode($userId, $id) {
try {
$userFolder = $this->rootFolder->getUserFolder($userId);
} catch (NotFoundException $e) {
} catch (NoUserException $e) {
throw new InvalidShare();
}

@ -0,0 +1,155 @@
<?php
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command line arguments will be applied
* after this file is read.
*
* @see src/Phan/Config.php
* See Config for all configurable options.
*/
return [
// A list of directories that should be parsed for class and
// method information. After excluding the directories
// defined in exclude_analysis_directory_list, the remaining
// files will be statically analyzed for errors.
//
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list' => [
'build/.phan/stubs',
'3rdparty',
'lib/composer',
'themes',
'lib/',
'apps/files_external/3rdparty',
'apps/',
'core/',
'ocs/',
'ocs-provider/',
'settings/',
'tests/lib/Util/User',
],
// A directory list that defines files that will be excluded
// from static analysis, but whose class and method
// information should be included.
//
// Generally, you'll want to include the directories for
// third-party code (such as "vendor/") in this list.
//
// n.b.: If you'd like to parse but not analyze 3rd
// party code, directories containing that code
// should be added to the `directory_list` as
// to `exclude_analysis_directory_list`.
"exclude_analysis_directory_list" => [
'3rdparty',
'lib/composer',
'apps/admin_audit/tests',
'apps/comments/tests',
'apps/dav/tests',
'apps/encryption/tests',
'apps/federatedfilesharing/tests',
'apps/federation/tests',
'apps/files/tests',
'apps/files_external/3rdparty',
'apps/files_external/tests',
'apps/files_sharing/tests',
'apps/files_trashbin/tests',
'apps/files_versions/tests',
'apps/lookup_server_connector/tests',
'apps/oauth2/tests',
'apps/provisioning_api/tests',
'apps/sharebymail/tests',
'apps/systemtags/tests',
'apps/testing/tests',
'apps/theming/tests',
'apps/twofactor_backupcodes/tests',
'apps/updatenotification/tests',
'apps/user_ldap/tests',
'apps/workflowengine/tests',
],
// The number of processes to fork off during the analysis
// phase.
'processes' => 10,
// Backwards Compatibility Checking. This is slow
// and expensive, but you should consider running
// it before upgrading your version of PHP to a
// new version that has backward compatibility
// breaks.
'backward_compatibility_checks' => false,
// Run a quick version of checks that takes less
// time at the cost of not running as thorough
// an analysis. You should consider setting this
// to true only when you wish you had more issues
// to fix in your code base.
'quick_mode' => true,
// If enabled, check all methods that override a
// parent method to make sure its signature is
// compatible with the parent's. This check
// can add quite a bit of time to the analysis.
'analyze_signature_compatibility' => false,
// The minimum severity level to report on. This can be
// set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
// Issue::SEVERITY_CRITICAL. Setting it to only
// critical issues is a good place to start on a big
// sloppy mature code base.
'minimum_severity' => 10,
// If true, missing properties will be created when
// they are first seen. If false, we'll report an
// error message if there is an attempt to write
// to a class property that wasn't explicitly
// defined.
'allow_missing_properties' => true,
// Allow null to be cast as any type and for any
// type to be cast to null. Setting this to false
// will cut down on false positives.
'null_casts_as_any_type' => true,
// Allow null to be cast as any array-like type (Requires 0.9.3+)
// This is an incremental step in migrating away from null_casts_as_any_type.
// If null_casts_as_any_type is true, this has no effect.
'null_casts_as_array' => false,
// Allow any array-like type to be cast to null. (Requires 0.9.3+)
// This is an incremental step in migrating away from null_casts_as_any_type.
// If null_casts_as_any_type is true, this has no effect.
'array_casts_as_null' => false,
// If enabled, scalars (int, float, bool, true, false, string, null)
// are treated as if they can cast to each other.
'scalar_implicit_cast' => true,
// If this has entries, scalars (int, float, bool, true, false, string, null)
// are allowed to perform the casts listed.
// E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
// allows casting null to a string, but not vice versa.
// (subset of scalar_implicit_cast)
// (Requires 0.9.3+)
'scalar_implicit_partial' => [],
// If true, seemingly undeclared variables in the global
// scope will be ignored. This is useful for projects
// with complicated cross-file globals that you have no
// hope of fixing.
'ignore_undeclared_variables_in_global_scope' => true,
// Add any issue types (such as 'PhanUndeclaredMethod')
// to this black-list to inhibit them from being reported.
'suppress_issue_types' => [
// 'PhanUndeclaredMethod',
],
// If empty, no filter against issues types will be applied.
// If this white-list is non-empty, only issues within the list
// will be emitted by Phan.
'whitelist_issue_types' => [
// 'PhanAccessMethodPrivate',
],
];

@ -0,0 +1,82 @@
<?php
/**
* The APCIterator class
*
* The APCIterator class makes it easier to iterate over large APC caches.
* This is helpful as it allows iterating over large caches in steps, while grabbing a defined number
* of entries per lock instance, so it frees the cache locks for other activities rather than hold up
* the entire cache to grab 100 (the default) entries. Also, using regular expression matching is more
* efficient as it's been moved to the C level.
*
* @link http://php.net/manual/en/class.apciterator.php
*/
class APCIterator implements Iterator
{
/**
* Constructs an APCIterator iterator object
* @link http://php.net/manual/en/apciterator.construct.php
* @param string $cache The cache type, which will be 'user' or 'file'.
* @param string|string[]|null $search A PCRE regular expression that matches against APC key names,
* either as a string for a single regular expression, or as an array of regular expressions.
* Or, optionally pass in NULL to skip the search.
* @param int $format The desired format, as configured with one ore more of the APC_ITER_* constants.
* @param int $chunk_size The chunk size. Must be a value greater than 0. The default value is 100.
* @param int $list The type to list. Either pass in APC_LIST_ACTIVE or APC_LIST_INACTIVE.
*/
public function __construct($cache, $search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE){}
/**
* Rewinds back the iterator to the first element
* @link http://php.net/manual/en/apciterator.rewind.php
*/
public function rewind(){}
/**
* Checks if the current iterator position is valid
* @link http://php.net/manual/en/apciterator.valid.php
* @return bool Returns TRUE if the current iterator position is valid, otherwise FALSE.
*/
public function valid(){}
/**
* Gets the current item from the APCIterator stack
* @link http://php.net/manual/en/apciterator.current.php
* @return mixed Returns the current item on success, or FALSE if no more items or exist, or on failure.
*/
public function current(){}
/**
* Gets the current iterator key
* @link http://php.net/manual/en/apciterator.key.php
* @return string|int|bool Returns the key on success, or FALSE upon failure.
*/
public function key(){}
/**
* Moves the iterator pointer to the next element
* @link http://php.net/manual/en/apciterator.next.php
* @return bool Returns TRUE on success or FALSE on failure.
*/
public function next(){}
/**
* Gets the total number of cache hits
* @link http://php.net/manual/en/apciterator.gettotalhits.php
* @return int|bool The number of hits on success, or FALSE on failure.
*/
public function getTotalHits(){}
/**
* Gets the total cache size
* @link http://php.net/manual/en/apciterator.gettotalsize.php
* @return int|bool The total cache size.
*/
public function getTotalSize(){}
/**
* Get the total count
* @link http://php.net/manual/en/apciterator.gettotalcount.php
* @return int|bool The total count.
*/
public function getTotalCount(){}
}

@ -0,0 +1,82 @@
<?php
/**
* The APCUIterator class
*
* The APCUIterator class makes it easier to iterate over large APCu caches.
* This is helpful as it allows iterating over large caches in steps, while grabbing a defined number
* of entries per lock instance, so it frees the cache locks for other activities rather than hold up
* the entire cache to grab 100 (the default) entries. Also, using regular expression matching is more
* efficient as it's been moved to the C level.
*
* @link http://php.net/manual/en/class.apcuiterator.php
* @since APCu 5.0.0
*/
class APCUIterator implements Iterator {
/**
* Constructs an APCUIterator iterator object
* @link http://php.net/manual/en/apcuiterator.construct.php
* @param string|string[]|null $search A PCRE regular expression that matches against APCu key names,
* either as a string for a single regular expression, or as an array of regular expressions.
* Or, optionally pass in NULL to skip the search.
* @param int $format The desired format, as configured with one ore more of the APC_ITER_* constants.
* @param int $chunk_size The chunk size. Must be a value greater than 0. The default value is 100.
* @param int $list The type to list. Either pass in APC_LIST_ACTIVE or APC_LIST_DELETED.
*/
public function __construct($search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE){}
/**
* Rewinds back the iterator to the first element
* @link http://php.net/manual/en/apcuiterator.rewind.php
*/
public function rewind(){}
/**
* Checks if the current iterator position is valid
* @link http://php.net/manual/en/apcuiterator.valid.php
* @return bool Returns TRUE if the current iterator position is valid, otherwise FALSE.
*/
public function valid(){}
/**
* Gets the current item from the APCUIterator stack
* @link http://php.net/manual/en/apcuiterator.current.php
* @return mixed Returns the current item on success, or FALSE if no more items or exist, or on failure.
*/
public function current(){}
/**
* Gets the current iterator key
* @link http://php.net/manual/en/apcuiterator.key.php
* @return string|int|bool Returns the key on success, or FALSE upon failure.
*/
public function key(){}
/**
* Moves the iterator pointer to the next element
* @link http://php.net/manual/en/apcuiterator.next.php
* @return bool Returns TRUE on success or FALSE on failure.
*/
public function next(){}
/**
* Gets the total number of cache hits
* @link http://php.net/manual/en/apcuiterator.gettotalhits.php
* @return int|bool The number of hits on success, or FALSE on failure.
*/
public function getTotalHits(){}
/**
* Gets the total cache size
* @link http://php.net/manual/en/apcuiterator.gettotalsize.php
* @return int|bool The total cache size.
*/
public function getTotalSize(){}
/**
* Get the total count
* @link http://php.net/manual/en/apcuiterator.gettotalcount.php
* @return int|bool The total count.
*/
public function getTotalCount(){}
}

@ -0,0 +1,318 @@
<?
/**
* Stubs for APC 3.1.4
*
* Author: Johnny Woo
* Date: Aug 9, 2010
* Time: 12:19:14 PM
*/
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_LIST_ACTIVE', 1);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_LIST_DELETED', 2);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_TYPE', 1);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_KEY', 2);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_FILENAME', 4);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_DEVICE', 8);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_INODE', 16);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_VALUE', 32);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_MD5', 64);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_NUM_HITS', 128);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_MTIME', 256);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_CTIME', 512);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_DTIME', 1024);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_ATIME', 2048);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_REFCOUNT', 4096);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_MEM_SIZE', 8192);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_TTL', 16384);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_NONE', 0);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_ITER_ALL', -1);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_BIN_VERIFY_MD5', 1);
/**
* @link http://php.net/manual/en/apc.constants.php
*/
define('APC_BIN_VERIFY_CRC32', 2);
/**
* Retrieves cached information and meta-data from APC's data store
* @link http://php.net/manual/en/function.apc-cache-info.php
* @param string $type If cache_type is "user", information about the user cache will be returned.
* If cache_type is "filehits", information about which files have been served from the bytecode
* cache for the current request will be returned. This feature must be enabled at compile time
* using --enable-filehits. If an invalid or no cache_type is specified, information about the
* system cache (cached files) will be returned.
* @param bool $limited If limited is TRUE, the return value will exclude the individual list
* of cache entries. This is useful when trying to optimize calls for statistics gathering.
* @return array|bool Array of cached data (and meta-data) or FALSE on failure.
*/
function apc_cache_info($type = '', $limited = false){}
/**
* Clears the APC cache
* @link http://php.net/manual/en/function.apc-clear-cache.php
* @param string $cache_type If cache_type is "user", the user cache will be cleared;
* otherwise, the system cache (cached files) will be cleared.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function apc_clear_cache($cache_type = ''){}
/**
* Retrieves APC's Shared Memory Allocation information
* @link http://php.net/manual/en/function.apc-sma-info.php
* @param bool $limited When set to FALSE (default) apc_sma_info() will
* return a detailed information about each segment.
* @return array|bool Array of Shared Memory Allocation data; FALSE on failure.
*/
function apc_sma_info($limited = false){}
/**
* Cache a variable in the data store
* @link http://php.net/manual/en/function.apc-store.php
* @param string|array $key String: Store the variable using this name. Keys are cache-unique,
* so storing a second value with the same key will overwrite the original value.
* Array: Names in key, variables in value.
* @param mixed $var [optional] The variable to store
* @param int $ttl [optional] Time To Live; store var in the cache for ttl seconds. After the ttl has passed,
* the stored variable will be expunged from the cache (on the next request). If no ttl is supplied
* (or if the ttl is 0), the value will persist until it is removed from the cache manually,
* or otherwise fails to exist in the cache (clear, restart, etc.).
* @return bool|array Returns TRUE on success or FALSE on failure | array with error keys.
*/
function apc_store($key, $var, $ttl = 0){}
/**
* Fetch a stored variable from the cache
* @link http://php.net/manual/en/function.apc-fetch.php
* @param string|string[] $key The key used to store the value (with apc_store()).
* If an array is passed then each element is fetched and returned.
* @param bool $success Set to TRUE in success and FALSE in failure.
* @return mixed The stored variable or array of variables on success; FALSE on failure.
*/
function apc_fetch($key, &$success = null){}
/**
* Removes a stored variable from the cache
* @link http://php.net/manual/en/function.apc-delete.php
* @param string|string[]|APCIterator $key The key used to store the value (with apc_store()).
* @return bool|string[] Returns TRUE on success or FALSE on failure. For array of keys returns list of failed keys.
*/
function apc_delete($key){}
/**
* Defines a set of constants for retrieval and mass-definition
*
* define() is notoriously slow. Since the main benefit of APC is to increase
* the performance of scripts/applications, this mechanism is provided to streamline
* the process of mass constant definition. However, this function does not perform
* as well as anticipated. For a better-performing solution, try the hidef extension from PECL.
*
* @link http://php.net/manual/en/function.apc-define-constants.php
* @param string $key The key serves as the name of the constant set being stored.
* This key is used to retrieve the stored constants in apc_load_constants().
* @param array $constants An associative array of constant_name => value pairs.
* The constant_name must follow the normal constant naming rules. Value must evaluate to a scalar value.
* @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
* i.e. CONSTANT and Constant represent different values. If this parameter evaluates to FALSE
* the constants will be declared as case-insensitive symbols.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function apc_define_constants($key, array $constants, $case_sensitive = true){}
/**
* Caches a variable in the data store, only if it's not already stored
* @link http://php.net/manual/en/function.apc-add.php
* @param string $key Store the variable using this name. Keys are cache-unique,
* so attempting to use apc_add() to store data with a key that already exists will not
* overwrite the existing data, and will instead return FALSE. (This is the only difference
* between apc_add() and apc_store().)
* @param mixed $var The variable to store
* @param int $ttl Time To Live; store var in the cache for ttl seconds. After the ttl has passed,
* the stored variable will be expunged from the cache (on the next request). If no ttl is supplied
* (or if the ttl is 0), the value will persist until it is removed from the cache manually,
* or otherwise fails to exist in the cache (clear, restart, etc.).
* @return bool
*/
function apc_add($key, $var, $ttl = 0){}
/**
* Stores a file in the bytecode cache, bypassing all filters
* @link http://php.net/manual/en/function.apc-compile-file.php
* @param string|string[] $filename Full or relative path to a PHP file that will be
* compiled and stored in the bytecode cache.
* @param bool $atomic
* @return bool Returns TRUE on success or FALSE on failure.
*/
function apc_compile_file($filename, $atomic = true){}
/**
* Loads a set of constants from the cache
* @link http://php.net/manual/en/function.apc-load-constants.php
* @param string $key The name of the constant set (that was stored
* with apc_define_constants()) to be retrieved.
* @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
* i.e. CONSTANT and Constant represent different values. If this parameter evaluates to FALSE
* the constants will be declared as case-insensitive symbols.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function apc_load_constants($key, $case_sensitive = true){}
/**
* Checks if APC key exists
* @link http://php.net/manual/en/function.apc-exists.php
* @param bool|string[] $keys A string, or an array of strings, that contain keys.
* @return bool|string[] Returns TRUE if the key exists, otherwise FALSE
* Or if an array was passed to keys, then an array is returned that
* contains all existing keys, or an empty array if none exist.
*/
function apc_exists($keys){}
/**
* Deletes the given files from the opcode cache
*
* Accepts a string, array of strings, or APCIterator object.
* Returns True/False, or for an Array an Array of failed files.
*
* @link http://php.net/manual/en/function.apc-delete-file.php
* @param string|string[]|APCIterator $keys
* @return bool|string[]
*/
function apc_delete_file($keys){}
/**
* Increase a stored number
* @link http://php.net/manual/en/function.apc-inc.php
* @param string $key The key of the value being increased.
* @param int $step The step, or value to increase.
* @param bool $success Optionally pass the success or fail boolean value to this referenced variable.
* @return int|bool Returns the current value of key's value on success, or FALSE on failure.
*/
function apc_inc($key, $step = 1, &$success = null){}
/**
* Decrease a stored number
* @link http://php.net/manual/en/function.apc-dec.php
* @param string $key The key of the value being decreased.
* @param int $step The step, or value to decrease.
* @param bool $success Optionally pass the success or fail boolean value to this referenced variable.
* @return int|bool Returns the current value of key's value on success, or FALSE on failure.
*/
function apc_dec($key, $step = 1, &$success = null){}
/**
* @link http://php.net/manual/en/function.apc-cas.php
* @param string $key
* @param int $old
* @param int $new
* @return bool
*/
function apc_cas($key, $old, $new){}
/**
* Returns a binary dump of the given files and user variables from the APC cache
*
* A NULL for files or user_vars signals a dump of every entry, while array() will dump nothing.
*
* @link http://php.net/manual/en/function.apc-bin-dump.php
* @param string[]|null $files The files. Passing in NULL signals a dump of every entry, while passing in array() will dump nothing.
* @param string[]|null $user_vars The user vars. Passing in NULL signals a dump of every entry, while passing in array() will dump nothing.
* @return string|bool|null Returns a binary dump of the given files and user variables from the APC cache, FALSE if APC is not enabled, or NULL if an unknown error is encountered.
*/
function apc_bin_dump($files = null, $user_vars = null){}
/**
* Output a binary dump of the given files and user variables from the APC cache to the named file
* @link http://php.net/manual/en/function.apc-bin-dumpfile.php
* @param string[]|null $files The file names being dumped.
* @param string[]|null $user_vars The user variables being dumped.
* @param string $filename The filename where the dump is being saved.
* @param int $flags Flags passed to the filename stream. See the file_put_contents() documentation for details.
* @param resource $context The context passed to the filename stream. See the file_put_contents() documentation for details.
* @return int|bool The number of bytes written to the file, otherwise FALSE if APC
* is not enabled, filename is an invalid file name, filename can't be opened,
* the file dump can't be completed (e.g., the hard drive is out of disk space),
* or an unknown error was encountered.
*/
function apc_bin_dumpfile($files, $user_vars, $filename, $flags = 0, $context = null){}
/**
* Load the given binary dump into the APC file/user cache
* @link http://php.net/manual/en/function.apc-bin-load.php
* @param string $data The binary dump being loaded, likely from apc_bin_dump().
* @param int $flags Either APC_BIN_VERIFY_CRC32, APC_BIN_VERIFY_MD5, or both.
* @return bool Returns TRUE if the binary dump data was loaded with success, otherwise FALSE is returned.
* FALSE is returned if APC is not enabled, or if the data is not a valid APC binary dump (e.g., unexpected size).
*/
function apc_bin_load($data, $flags = 0){}
/**
* Load the given binary dump from the named file into the APC file/user cache
* @link http://php.net/manual/en/function.apc-bin-loadfile.php
* @param string $filename The file name containing the dump, likely from apc_bin_dumpfile().
* @param resource $context The files context.
* @param int $flags Either APC_BIN_VERIFY_CRC32, APC_BIN_VERIFY_MD5, or both.
* @return bool Returns TRUE on success, otherwise FALSE Reasons it may return FALSE include APC
* is not enabled, filename is an invalid file name or empty, filename can't be opened,
* the file dump can't be completed, or if the data is not a valid APC binary dump (e.g., unexpected size).
*/
function apc_bin_loadfile($filename, $context = null, $flags = 0){}

@ -0,0 +1,235 @@
<?php
/**
* Stubs for APCu 5.0.0
*/
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_LIST_ACTIVE', 1);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_LIST_DELETED', 2);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_TYPE', 1);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_KEY', 2);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_FILENAME', 4);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_DEVICE', 8);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_INODE', 16);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_VALUE', 32);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_MD5', 64);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_NUM_HITS', 128);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_MTIME', 256);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_CTIME', 512);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_DTIME', 1024);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_ATIME', 2048);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_REFCOUNT', 4096);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_MEM_SIZE', 8192);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_TTL', 16384);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_NONE', 0);
/**
* @link http://php.net/manual/en/apcu.constants.php
*/
define('APC_ITER_ALL', -1);
/**
* Clears the APCu cache
* @link http://php.net/manual/en/function.apcu-clear-cache.php
*
* @return bool Returns TRUE always.
*/
function apcu_clear_cache(){}
/**
* Retrieves APCu Shared Memory Allocation information
* @link http://php.net/manual/en/function.apcu-sma-info.php
* @param bool $limited When set to FALSE (default) apcu_sma_info() will
* return a detailed information about each segment.
*
* @return array|bool Array of Shared Memory Allocation data; FALSE on failure.
*/
function apcu_sma_info($limited = false){}
/**
* Cache a variable in the data store
* @link http://php.net/manual/en/function.apcu-store.php
* @param string|array $key String: Store the variable using this name. Keys are cache-unique,
* so storing a second value with the same key will overwrite the original value.
* Array: Names in key, variables in value.
* @param mixed $var [optional] The variable to store
* @param int $ttl [optional] Time To Live; store var in the cache for ttl seconds. After the ttl has passed,
* the stored variable will be expunged from the cache (on the next request). If no ttl is supplied
* (or if the ttl is 0), the value will persist until it is removed from the cache manually,
* or otherwise fails to exist in the cache (clear, restart, etc.).
* @return bool|array Returns TRUE on success or FALSE on failure | array with error keys.
*/
function apcu_store($key, $var, $ttl = 0){}
/**
* Fetch a stored variable from the cache
* @link http://php.net/manual/en/function.apcu-fetch.php
* @param string|string[] $key The key used to store the value (with apcu_store()).
* If an array is passed then each element is fetched and returned.
* @param bool $success Set to TRUE in success and FALSE in failure.
* @return mixed The stored variable or array of variables on success; FALSE on failure.
*/
function apcu_fetch($key, &$success = null){}
/**
* Removes a stored variable from the cache
* @link http://php.net/manual/en/function.apcu-delete.php
* @param string|string[]|APCUIterator $key The key used to store the value (with apcu_store()).
* @return bool|string[] Returns TRUE on success or FALSE on failure. For array of keys returns list of failed keys.
*/
function apcu_delete($key){}
/**
* Caches a variable in the data store, only if it's not already stored
* @link http://php.net/manual/en/function.apcu-add.php
* @param string $key Store the variable using this name. Keys are cache-unique,
* so attempting to use apcu_add() to store data with a key that already exists will not
* overwrite the existing data, and will instead return FALSE. (This is the only difference
* between apcu_add() and apcu_store().)
* @param mixed $var The variable to store
* @param int $ttl Time To Live; store var in the cache for ttl seconds. After the ttl has passed,
* the stored variable will be expunged from the cache (on the next request). If no ttl is supplied
* (or if the ttl is 0), the value will persist until it is removed from the cache manually,
* or otherwise fails to exist in the cache (clear, restart, etc.).
* @return bool
*/
function apcu_add($key, $var, $ttl = 0){}
/**
* Checks if APCu key exists
* @link http://php.net/manual/en/function.apcu-exists.php
* @param string|string[] $keys A string, or an array of strings, that contain keys.
* @return bool|string[] Returns TRUE if the key exists, otherwise FALSE
* Or if an array was passed to keys, then an array is returned that
* contains all existing keys, or an empty array if none exist.
*/
function apcu_exists($keys){}
/**
* Increase a stored number
* @link http://php.net/manual/en/function.apcu-inc.php
* @param string $key The key of the value being increased.
* @param int $step The step, or value to increase.
* @param bool $success Optionally pass the success or fail boolean value to this referenced variable.
* @return int|bool Returns the current value of key's value on success, or FALSE on failure.
*/
function apcu_inc($key, $step = 1, &$success = null){}
/**
* Decrease a stored number
* @link http://php.net/manual/en/function.apcu-dec.php
* @param string $key The key of the value being decreased.
* @param int $step The step, or value to decrease.
* @param bool $success Optionally pass the success or fail boolean value to this referenced variable.
* @return int|bool Returns the current value of key's value on success, or FALSE on failure.
*/
function apcu_dec($key, $step = 1, &$success = null){}
/**
* Updates an old value with a new value
*
* apcu_cas() updates an already existing integer value if the old parameter matches the currently stored value
* with the value of the new parameter.
*
* @link http://php.net/manual/en/function.apcu-cas.php
* @param string $key The key of the value being updated.
* @param int $old The old value (the value currently stored).
* @param int $new The new value to update to.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function apcu_cas($key, $old, $new){}
/**
* Atomically fetch or generate a cache entry
*
* <p>Atomically attempts to find key in the cache, if it cannot be found generator is called,
* passing key as the only argument. The return value of the call is then cached with the optionally
* specified ttl, and returned.
* </p>
*
* <p>Note: When control enters <i>apcu_entry()</i> the lock for the cache is acquired exclusively, it is released when
* control leaves apcu_entry(): In effect, this turns the body of generator into a critical section,
* disallowing two processes from executing the same code paths concurrently.
* In addition, it prohibits the concurrent execution of any other APCu functions,
* since they will acquire the same lock.
* </p>
*
* @link http://php.net/manual/en/function.apcu-entry.php
*
* @param string $key Identity of cache entry
* @param callable $generator A callable that accepts key as the only argument and returns the value to cache.
* <p>Warning
* The only APCu function that can be called safely by generator is apcu_entry().</p>
* @param int $ttl [optional] Time To Live; store var in the cache for ttl seconds.
* After the ttl has passed, the stored variable will be expunged from the cache (on the next request).
* If no ttl is supplied (or if the ttl is 0), the value will persist until it is removed from the cache manually,
* or otherwise fails to exist in the cache (clear, restart, etc.).
* @return mixed Returns the cached value
* @since APCu 5.1.0
*/
function apcu_entry($key, callable $generator, $ttl = 0){}
/**
* Retrieves cached information from APCu's data store
*
* @link http://php.net/manual/en/function.apcu-cache-info.php
*
* @param bool $limited If limited is TRUE, the return value will exclude the individual list of cache entries.
* This is useful when trying to optimize calls for statistics gathering.
* @return array|bool Array of cached data (and meta-data) or FALSE on failure
*/
function apcu_cache_info($limited = false){}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,217 @@
<?php
/**
* Common Used Functions
*/
/**
* Get cached data by specified name
*
* @param string $name Key name
* @return mixed
*/
function xcache_get($name) {}
/**
* Store data to cache by specified name
*
* @param string $name Key name
* @param mixed $value Value to store
* @param int $ttl TTL in seconds
* @return bool TRUE on success, FALSE otherwise
*/
function xcache_set($name, $value, $ttl = 0) {}
/**
* Check if an entry exists in cache by specified name
*
* @param string $name Key name
* @return bool TRUE if key exists, FALSE otherwise
*/
function xcache_isset($name) {}
/**
* Unset existing data in cache by specified name
*
* @param string $name Key name
* @return bool
*/
function xcache_unset($name) {}
/**
* Unset existing data in cache by specified prefix
*
* @param string $prefix Keys' prefix
* @return bool
*/
function xcache_unset_by_prefix($prefix) {}
/**
* Increase an int counter in cache by specified name, create it if not exists
*
* @param string $name
* @param mixed $value
* @param int $ttl
* @return int
*/
function xcache_inc($name, $value = 1, $ttl = 0) {}
/**
* Decrease an int counter in cache by specified name, create it if not exists
*
* @param string $name
* @param mixed $value
* @param int $ttl
* @return int
*/
function xcache_dec($name, $value = 1, $ttl = 0) {}
/**
* Administrator Functions
*/
/**
* Return count of cache on specified cache type
*
* @param int $type
* @return int
*/
function xcache_count($type) {}
/**
* Get cache info by id on specified cache type
*
* @param int $type
* @param int $id
* @return array
*/
function xcache_info($type, $id) {}
/**
* Get cache entries list by id on specified cache type
*
* @param int $type
* @param int $id
* @return array
*/
function xcache_list($type, $id) {}
/**
* Clear cache by id on specified cache type
*
* @param int $type
* @param int $id
* @return void
*/
function xcache_clear_cache($type, $id = -1) {}
/**
* @param int $op_type
* @return string
*/
function xcache_coredump($op_type) {}
/**
* Coverager Functions
*/
/**
* @param string $data
* @return array
*/
function xcache_coverager_decode($data) {}
/**
* @param bool $clean
* @return void
*/
function xcache_coverager_start($clean = true) {}
/**
* @param bool $clean
* @return void
*/
function xcache_coverager_stop($clean = false) {}
/**
* @param bool $clean
* @return array
*/
function xcache_coverager_get($clean = false) {}
/**
* Opcode Functions
*/
/**
* @param string $filename
* @return string
*/
function xcache_asm($filename) {}
/**
* Disassemble file into opcode array by filename
*
* @param string $filename
* @return string
*/
function xcache_dasm_file($filename) {}
/**
* Disassemble php code into opcode array
*
* @param string $code
* @return string
*/
function xcache_dasm_string($code) {}
/**
* Encode php file into XCache opcode encoded format
*
* @param string $filename
* @return string
*/
function xcache_encode($filename) {}
/**
* Decode(load) opcode from XCache encoded format file
*
* @param string $filename
* @return bool
*/
function xcache_decode($filename) {}
/**
* @param int $op_type
* @return string
*/
function xcache_get_op_type($op_type) {}
/**
* @param int $type
* @return string
*/
function xcache_get_data_type($type) {}
/**
* @param int $opcode
* @return string
*/
function xcache_get_opcode($opcode) {}
/**
* @param int $op_type
* @return string
*/
function xcache_get_op_spec($op_type) {}
/**
* @param int $opcode
* @return string
*/
function xcache_get_opcode_spec($opcode) {}
/**
* @param string $name
* @return string
*/
function xcache_is_autoglobal($name) {}

@ -13,6 +13,7 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
"jakub-onderka/php-console-highlighter": "^0.3.2"
"jakub-onderka/php-console-highlighter": "^0.3.2",
"etsy/phan": "0.8.x-dev"
}
}

@ -89,6 +89,10 @@ $this->create('files.viewcontroller.showFile', '/f/{fileid}')->action(function($
});
// Call routes
/**
* @suppress PhanUndeclaredClassConstant
* @suppress PhanUndeclaredClassMethod
*/
$this->create('spreed.pagecontroller.showCall', '/call/{token}')->action(function($urlParams) {
if (class_exists(\OCA\Spreed\AppInfo\Application::class, false)) {
$app = new \OCA\Spreed\AppInfo\Application($urlParams);

@ -35,7 +35,7 @@ class QueryLogger implements IQueryLogger {
protected $activeQuery;
/**
* @var \OC\Diagnostics\Query[]
* @var CappedMemoryCache
*/
protected $queries;

@ -1292,7 +1292,7 @@ class View {
* @param \OC\Files\Storage\Storage $storage
* @param string $internalPath
* @param string $relativePath
* @return array|bool
* @return ICacheEntry|bool
*/
private function getCacheEntry($storage, $internalPath, $relativePath) {
$cache = $storage->getCache($internalPath);

@ -168,6 +168,8 @@ class Manager implements IManager {
* @param \OCP\Share\IShare $share
* @throws \InvalidArgumentException
* @throws GenericShareException
*
* @suppress PhanUndeclaredClassMethod
*/
protected function generalCreateChecks(\OCP\Share\IShare $share) {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {

@ -177,6 +177,8 @@ class ProviderFactory implements IProviderFactory {
* Create the circle share provider
*
* @return FederatedShareProvider
*
* @suppress PhanUndeclaredClassMethod
*/
protected function getShareByCircleProvider() {

Loading…
Cancel
Save