Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Reads entire file into an array
<?php file(string $filename, int $flags = 0, ?resource $context = null): array|false
<?php return Str::startsWith($envLine, $key)
? "{$key}={$value}".PHP_EOL
: $envLine;
}, file($envPath));
file_put_contents($envPath, implode('', $envLines));
}
<?php $this->assertNoViolation($file, 2);
$lineCount = \count(\file($filename));
for ($i = 3; $i < $lineCount; $i++) {
<?php $pattern = sprintf('{^/?%s(/\*?)?$}', preg_quote($vendor));
$lines = file($ignoreFile, FILE_IGNORE_NEW_LINES);
foreach ($lines as $line) {
if (Preg::isMatch($pattern, $line)) {
return true;
<?php $this->excludePatterns = array_merge(
$this->excludePatterns,
$this->parseLines(
file($sourcePath.'/.gitattributes'),
array($this, 'parseGitAttributesLine')
)
);
<?php {
$relativePath = str_replace((string) getcwd(), '.', $issue->file);
$lines = file($issue->file);
$lineContent = $lines[$issue->line - 1] ?? '';
$column = $this->getIssueColumn($issue, $lineContent);