Last active
January 15, 2018 20:46
-
-
Save Zae/d52a9b7efc48ca14fb92af13c0cd4a3d to your computer and use it in GitHub Desktop.
psalm bad files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Symfony package. | |
* | |
* (c) Fabien Potencier <fabien@symfony.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Symfony\Component\DependencyInjection; | |
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; | |
/** | |
* Adds some function to the default ExpressionLanguage. | |
* | |
* @author Fabien Potencier <fabien@symfony.com> | |
* | |
* @see ExpressionLanguageProvider | |
*/ | |
class ExpressionLanguage extends BaseExpressionLanguage | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function __construct($cache = null, array $providers = array(), callable $serviceCompiler = null) | |
{ | |
// prepend the default provider to let users override it easily | |
array_unshift($providers, new ExpressionLanguageProvider($serviceCompiler)); | |
parent::__construct($cache, $providers); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Steve Krämer | |
*/ | |
$drivers['firebird'] = 'Firebird (alpha)'; | |
if (isset($_GET["firebird"])) { | |
$possible_drivers = array("interbase"); | |
define("DRIVER", "firebird"); | |
if (extension_loaded("interbase") ) { | |
class Min_DB { | |
var | |
$extension = "Firebird", | |
$server_info, | |
$affected_rows, | |
$errno, | |
$error, | |
$_link, $_result | |
; | |
function connect($server, $username, $password) { | |
$this->_link = ibase_connect($server, $username, $password); | |
if ($this->_link) { | |
$url_parts = explode(':', $server); | |
$this->service_link = ibase_service_attach($url_parts[0], $username, $password); | |
$this->server_info = ibase_server_info($this->service_link, IBASE_SVC_SERVER_VERSION); | |
} else { | |
$this->errno = ibase_errcode(); | |
$this->error = ibase_errmsg(); | |
} | |
return (bool) $this->_link; | |
} | |
function quote($string) { | |
return "'" . str_replace("'", "''", $string) . "'"; | |
} | |
function select_db($database) { | |
return ($database == "domain"); | |
} | |
function query($query, $unbuffered = false) { | |
$result = ibase_query($query, $this->_link); | |
if (!$result) { | |
$this->errno = ibase_errcode(); | |
$this->error = ibase_errmsg(); | |
return false; | |
} | |
$this->error = ""; | |
if ($result === true) { | |
$this->affected_rows = ibase_affected_rows($this->_link); | |
return true; | |
} | |
return new Min_Result($result); | |
} | |
function multi_query($query) { | |
return $this->_result = $this->query($query); | |
} | |
function store_result() { | |
return $this->_result; | |
} | |
function next_result() { | |
return false; | |
} | |
function result($query, $field = 0) { | |
$result = $this->query($query); | |
if (!$result || !$result->num_rows) { | |
return false; | |
} | |
$row = $result->fetch_row(); | |
return $row[$field]; | |
} | |
} | |
class Min_Result { | |
var $num_rows, $_result, $_offset = 0; | |
function __construct($result) { | |
$this->_result = $result; | |
// $this->num_rows = ibase_num_rows($result); | |
} | |
function fetch_assoc() { | |
return ibase_fetch_assoc($this->_result); | |
} | |
function fetch_row() { | |
return ibase_fetch_row($this->_result); | |
} | |
function fetch_field() { | |
$field = ibase_field_info($this->_result, $this->_offset++); | |
return (object) array( | |
'name' => $field['name'], | |
'orgname' => $field['name'], | |
'type' => $field['type'], | |
'charsetnr' => $field['length'], | |
); | |
} | |
function __destruct() { | |
ibase_free_result($this->_result); | |
} | |
} | |
} | |
class Min_Driver extends Min_SQL { | |
} | |
function idf_escape($idf) { | |
return '"' . str_replace('"', '""', $idf) . '"'; | |
} | |
function table($idf) { | |
return idf_escape($idf); | |
} | |
function connect() { | |
global $adminer; | |
$connection = new Min_DB; | |
$credentials = $adminer->credentials(); | |
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) { | |
return $connection; | |
} | |
return $connection->error; | |
} | |
function get_databases($flush) { | |
return array("domain"); | |
} | |
function limit($query, $where, $limit, $offset = 0, $separator = " ") { | |
$return = ''; | |
$return .= ($limit !== null ? $separator . "FIRST $limit" . ($offset ? " SKIP $offset" : "") : ""); | |
$return .= " $query$where"; | |
return $return; | |
} | |
function limit1($query, $where) { | |
return limit($query, $where, 1); | |
} | |
function db_collation($db, $collations) { | |
} | |
function engines() { | |
return array(); | |
} | |
function logged_user() { | |
global $adminer; | |
$credentials = $adminer->credentials(); | |
return $credentials[1]; | |
} | |
function tables_list() { | |
global $connection; | |
$query = 'SELECT RDB$RELATION_NAME FROM rdb$relations WHERE rdb$system_flag = 0'; | |
$result = ibase_query($connection->_link, $query); | |
$return = array(); | |
while ($row = ibase_fetch_assoc($result)) { | |
$return[$row['RDB$RELATION_NAME']] = 'table'; | |
} | |
ksort($return); | |
return $return; | |
} | |
function count_tables($databases) { | |
return array(); | |
} | |
function table_status($name = "", $fast = false) { | |
global $connection; | |
$return = array(); | |
$data = tables_list(); | |
foreach ($data as $index => $val) { | |
$index = trim($index); | |
$return[$index] = array( | |
'Name' => $index, | |
'Engine' => 'standard', | |
); | |
if ($name == $index) { | |
return $return[$index]; | |
} | |
} | |
return $return; | |
} | |
function is_view($table_status) { | |
return false; | |
} | |
function fk_support($table_status) { | |
return preg_match('~InnoDB|IBMDB2I~i', $table_status["Engine"]); | |
} | |
function fields($table) { | |
global $connection; | |
$return = array(); | |
$query = 'SELECT r.RDB$FIELD_NAME AS field_name, | |
r.RDB$DESCRIPTION AS field_description, | |
r.RDB$DEFAULT_VALUE AS field_default_value, | |
r.RDB$NULL_FLAG AS field_not_null_constraint, | |
f.RDB$FIELD_LENGTH AS field_length, | |
f.RDB$FIELD_PRECISION AS field_precision, | |
f.RDB$FIELD_SCALE AS field_scale, | |
CASE f.RDB$FIELD_TYPE | |
WHEN 261 THEN \'BLOB\' | |
WHEN 14 THEN \'CHAR\' | |
WHEN 40 THEN \'CSTRING\' | |
WHEN 11 THEN \'D_FLOAT\' | |
WHEN 27 THEN \'DOUBLE\' | |
WHEN 10 THEN \'FLOAT\' | |
WHEN 16 THEN \'INT64\' | |
WHEN 8 THEN \'INTEGER\' | |
WHEN 9 THEN \'QUAD\' | |
WHEN 7 THEN \'SMALLINT\' | |
WHEN 12 THEN \'DATE\' | |
WHEN 13 THEN \'TIME\' | |
WHEN 35 THEN \'TIMESTAMP\' | |
WHEN 37 THEN \'VARCHAR\' | |
ELSE \'UNKNOWN\' | |
END AS field_type, | |
f.RDB$FIELD_SUB_TYPE AS field_subtype, | |
coll.RDB$COLLATION_NAME AS field_collation, | |
cset.RDB$CHARACTER_SET_NAME AS field_charset | |
FROM RDB$RELATION_FIELDS r | |
LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME | |
LEFT JOIN RDB$COLLATIONS coll ON f.RDB$COLLATION_ID = coll.RDB$COLLATION_ID | |
LEFT JOIN RDB$CHARACTER_SETS cset ON f.RDB$CHARACTER_SET_ID = cset.RDB$CHARACTER_SET_ID | |
WHERE r.RDB$RELATION_NAME = ' . q($table) . ' | |
ORDER BY r.RDB$FIELD_POSITION'; | |
$result = ibase_query($connection->_link, $query); | |
while ($row = ibase_fetch_assoc($result)) { | |
$return[trim($row['FIELD_NAME'])] = array( | |
"field" => trim($row["FIELD_NAME"]), | |
"full_type" => trim($row["FIELD_TYPE"]), | |
"type" => trim($row["FIELD_SUB_TYPE"]), | |
"default" => trim($row['FIELD_DEFAULT_VALUE']), | |
"null" => (trim($row["FIELD_NOT_NULL_CONSTRAINT"]) == "YES"), | |
"auto_increment" => '0', | |
"collation" => trim($row["FIELD_COLLATION"]), | |
"privileges" => array("insert" => 1, "select" => 1, "update" => 1), | |
"comment" => trim($row["FIELD_DESCRIPTION"]), | |
); | |
} | |
return $return; | |
} | |
function indexes($table, $connection2 = null) { | |
$return = array(); | |
/* | |
$query = 'SELECT RDB$INDEX_SEGMENTS.RDB$FIELD_NAME AS field_name, | |
RDB$INDICES.RDB$DESCRIPTION AS description, | |
(RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION + 1) AS field_position | |
FROM RDB$INDEX_SEGMENTS | |
LEFT JOIN RDB$INDICES ON RDB$INDICES.RDB$INDEX_NAME = RDB$INDEX_SEGMENTS.RDB$INDEX_NAME | |
LEFT JOIN RDB$RELATION_CONSTRAINTS ON RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME = RDB$INDEX_SEGMENTS.RDB$INDEX_NAME | |
WHERE UPPER(RDB$INDICES.RDB$RELATION_NAME) = ' . q($table) . ' | |
// AND UPPER(RDB$INDICES.RDB$INDEX_NAME) = \'TEST2_FIELD5_IDX\' | |
AND RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_TYPE IS NULL | |
ORDER BY RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION'; | |
*/ | |
return $return; | |
} | |
function foreign_keys($table) { | |
return array(); | |
} | |
function collations() { | |
return array(); | |
} | |
function information_schema($db) { | |
return false; | |
} | |
function error() { | |
global $connection; | |
return h($connection->error); | |
} | |
function types() { | |
return array(); | |
} | |
function schemas() { | |
return array(); | |
} | |
function get_schema() { | |
return ""; | |
} | |
function set_schema($schema) { | |
return true; | |
} | |
function support($feature) { | |
return preg_match("~^(columns|sql|status|table)$~", $feature); | |
} | |
$jush = "firebird"; | |
$operators = array("="); | |
$functions = array(); | |
$grouping = array(); | |
$edit_functions = array(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\DependencyInjection\Container; | |
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; | |
use Symfony\Component\DependencyInjection\Exception\LogicException; | |
use Symfony\Component\DependencyInjection\Exception\RuntimeException; | |
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; | |
/** | |
* This class has been auto-generated | |
* by the Symfony Dependency Injection Component. | |
* | |
* @final since Symfony 3.3 | |
*/ | |
class ProjectServiceContainer extends Container | |
{ | |
private $parameters; | |
private $targetDirs = array(); | |
public function __construct() | |
{ | |
$this->services = array(); | |
$this->methodMap = array( | |
'bar_service' => 'getBarServiceService', | |
'baz_service' => 'getBazServiceService', | |
'foo_service' => 'getFooServiceService', | |
'translator.loader_1' => 'getTranslator_Loader1Service', | |
'translator.loader_2' => 'getTranslator_Loader2Service', | |
'translator.loader_3' => 'getTranslator_Loader3Service', | |
'translator_1' => 'getTranslator1Service', | |
'translator_2' => 'getTranslator2Service', | |
'translator_3' => 'getTranslator3Service', | |
); | |
$this->privates = array( | |
'baz_service' => true, | |
); | |
$this->aliases = array(); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function compile() | |
{ | |
throw new LogicException('You cannot compile a dumped container that was already compiled.'); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function isCompiled() | |
{ | |
return true; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function isFrozen() | |
{ | |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED); | |
return true; | |
} | |
/** | |
* Gets the public 'bar_service' shared service. | |
* | |
* @return \stdClass | |
*/ | |
protected function getBarServiceService() | |
{ | |
return $this->services['bar_service'] = new \stdClass(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->getBazServiceService()) && false ?: '_'}); | |
} | |
/** | |
* Gets the public 'foo_service' shared service. | |
* | |
* @return \Symfony\Component\DependencyInjection\ServiceLocator | |
*/ | |
protected function getFooServiceService() | |
{ | |
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\ServiceLocator(array('bar' => function () { | |
return ${($_ = isset($this->services['bar_service']) ? $this->services['bar_service'] : $this->get('bar_service')) && false ?: '_'}; | |
}, 'baz' => function () { | |
$f = function (\stdClass $v) { return $v; }; return $f(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->getBazServiceService()) && false ?: '_'}); | |
}, 'nil' => function () { | |
return NULL; | |
})); | |
} | |
/** | |
* Gets the public 'translator.loader_1' shared service. | |
* | |
* @return \stdClass | |
*/ | |
protected function getTranslator_Loader1Service() | |
{ | |
return $this->services['translator.loader_1'] = new \stdClass(); | |
} | |
/** | |
* Gets the public 'translator.loader_2' shared service. | |
* | |
* @return \stdClass | |
*/ | |
protected function getTranslator_Loader2Service() | |
{ | |
return $this->services['translator.loader_2'] = new \stdClass(); | |
} | |
/** | |
* Gets the public 'translator.loader_3' shared service. | |
* | |
* @return \stdClass | |
*/ | |
protected function getTranslator_Loader3Service() | |
{ | |
return $this->services['translator.loader_3'] = new \stdClass(); | |
} | |
/** | |
* Gets the public 'translator_1' shared service. | |
* | |
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator | |
*/ | |
protected function getTranslator1Service() | |
{ | |
return $this->services['translator_1'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_1' => function () { | |
return ${($_ = isset($this->services['translator.loader_1']) ? $this->services['translator.loader_1'] : $this->get('translator.loader_1')) && false ?: '_'}; | |
}))); | |
} | |
/** | |
* Gets the public 'translator_2' shared service. | |
* | |
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator | |
*/ | |
protected function getTranslator2Service() | |
{ | |
$this->services['translator_2'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_2' => function () { | |
return ${($_ = isset($this->services['translator.loader_2']) ? $this->services['translator.loader_2'] : $this->get('translator.loader_2')) && false ?: '_'}; | |
}))); | |
$instance->addResource('db', ${($_ = isset($this->services['translator.loader_2']) ? $this->services['translator.loader_2'] : $this->get('translator.loader_2')) && false ?: '_'}, 'nl'); | |
return $instance; | |
} | |
/** | |
* Gets the public 'translator_3' shared service. | |
* | |
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator | |
*/ | |
protected function getTranslator3Service() | |
{ | |
$a = ${($_ = isset($this->services['translator.loader_3']) ? $this->services['translator.loader_3'] : $this->get('translator.loader_3')) && false ?: '_'}; | |
$this->services['translator_3'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_3' => function () { | |
return ${($_ = isset($this->services['translator.loader_3']) ? $this->services['translator.loader_3'] : $this->get('translator.loader_3')) && false ?: '_'}; | |
}))); | |
$instance->addResource('db', $a, 'nl'); | |
$instance->addResource('db', $a, 'en'); | |
return $instance; | |
} | |
/** | |
* Gets the private 'baz_service' shared service. | |
* | |
* @return \stdClass | |
*/ | |
protected function getBazServiceService() | |
{ | |
return $this->services['baz_service'] = new \stdClass(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment