Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,86 +12,20 @@ parameters:
count: 1
path: src/Parser/Lexer.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ApacheAdapter\>\.$#'
identifier: varTag.type
count: 1
path: src/Repository/Adapter/ApacheAdapter.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ArrayAdapter\>\.$#'
identifier: varTag.type
count: 1
path: src/Repository/Adapter/ArrayAdapter.php

-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 1
path: src/Repository/Adapter/EnvConstAdapter.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\EnvConstAdapter\>\.$#'
identifier: varTag.type
count: 1
path: src/Repository/Adapter/EnvConstAdapter.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\PutenvAdapter\>\.$#'
identifier: varTag.type
count: 1
path: src/Repository/Adapter/PutenvAdapter.php

-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 1
path: src/Repository/Adapter/ServerConstAdapter.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ServerConstAdapter\>\.$#'
identifier: varTag.type
count: 1
path: src/Repository/Adapter/ServerConstAdapter.php

-
message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\AdapterInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\AdapterInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
identifier: argument.type
count: 1
path: src/Repository/RepositoryBuilder.php

-
message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ReaderInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\ReaderInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
identifier: argument.type
count: 1
path: src/Repository/RepositoryBuilder.php

-
message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\WriterInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\WriterInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
identifier: argument.type
count: 1
path: src/Repository/RepositoryBuilder.php

-
message: '#^Parameter \#1 \$readers of class Dotenv\\Repository\\RepositoryBuilder constructor expects array\<Dotenv\\Repository\\Adapter\\ReaderInterface\>, array\<Dotenv\\Repository\\Adapter\\ReaderInterface\|S\> given\.$#'
identifier: argument.type
count: 2
path: src/Repository/RepositoryBuilder.php

-
message: '#^Parameter \#2 \$writers of class Dotenv\\Repository\\RepositoryBuilder constructor expects array\<Dotenv\\Repository\\Adapter\\WriterInterface\>, array\<Dotenv\\Repository\\Adapter\\WriterInterface\|S\> given\.$#'
identifier: argument.type
count: 2
path: src/Repository/RepositoryBuilder.php

-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
count: 1
path: src/Util/Str.php

-
message: '#^PHPDoc tag @var with type PhpOption\\Option\<int\> is not subtype of type PhpOption\\Option\<int\<0, max\>\|false\>\.$#'
identifier: varTag.type
count: 1
path: src/Util/Str.php
3 changes: 1 addition & 2 deletions src/Repository/Adapter/ApacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ private function __construct()
/**
* Create a new instance of the adapter, if it is available.
*
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
* @return \PhpOption\Option<self>
*/
public static function create()
{
if (self::isSupported()) {
/** @var \PhpOption\Option<AdapterInterface> */
return Some::create(new self());
}

Expand Down
3 changes: 1 addition & 2 deletions src/Repository/Adapter/ArrayAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ private function __construct()
/**
* Create a new instance of the adapter, if it is available.
*
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
* @return \PhpOption\Option<self>
*/
public static function create()
{
/** @var \PhpOption\Option<AdapterInterface> */
return Some::create(new self());
}

Expand Down
3 changes: 1 addition & 2 deletions src/Repository/Adapter/EnvConstAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ private function __construct()
/**
* Create a new instance of the adapter, if it is available.
*
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
* @return \PhpOption\Option<self>
*/
public static function create()
{
/** @var \PhpOption\Option<AdapterInterface> */
return Some::create(new self());
}

Expand Down
3 changes: 1 addition & 2 deletions src/Repository/Adapter/PutenvAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ private function __construct()
/**
* Create a new instance of the adapter, if it is available.
*
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
* @return \PhpOption\Option<self>
*/
public static function create()
{
if (self::isSupported()) {
/** @var \PhpOption\Option<AdapterInterface> */
return Some::create(new self());
}

Expand Down
3 changes: 1 addition & 2 deletions src/Repository/Adapter/ServerConstAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ private function __construct()
/**
* Create a new instance of the adapter, if it is available.
*
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
* @return \PhpOption\Option<self>
*/
public static function create()
{
/** @var \PhpOption\Option<AdapterInterface> */
return Some::create(new self());
}

Expand Down
6 changes: 3 additions & 3 deletions src/Repository/RepositoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private static function isAnAdapterClass(string $name)
* Accepts either a reader instance, or a class-string for an adapter. If
* the adapter is not supported, then we silently skip adding it.
*
* @param \Dotenv\Repository\Adapter\ReaderInterface|string $reader
* @param \Dotenv\Repository\Adapter\ReaderInterface|class-string<\Dotenv\Repository\Adapter\AdapterInterface> $reader
*
* @throws \InvalidArgumentException
*
Expand Down Expand Up @@ -165,7 +165,7 @@ public function addReader($reader)
* Accepts either a writer instance, or a class-string for an adapter. If
* the adapter is not supported, then we silently skip adding it.
*
* @param \Dotenv\Repository\Adapter\WriterInterface|string $writer
* @param \Dotenv\Repository\Adapter\WriterInterface|class-string<\Dotenv\Repository\Adapter\AdapterInterface> $writer
*
* @throws \InvalidArgumentException
*
Expand Down Expand Up @@ -199,7 +199,7 @@ public function addWriter($writer)
* the adapter is not supported, then we silently skip adding it. We will
* add the adapter as both a reader and a writer.
*
* @param \Dotenv\Repository\Adapter\WriterInterface|string $adapter
* @param \Dotenv\Repository\Adapter\AdapterInterface|class-string<\Dotenv\Repository\Adapter\AdapterInterface> $adapter
*
* @throws \InvalidArgumentException
*
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function matches(string $pattern, string $subject)
* @param string $pattern
* @param string $subject
*
* @return \GrahamCampbell\ResultType\Result<int, string>
* @return \GrahamCampbell\ResultType\Result<int<0, max>, string>
*/
public static function occurrences(string $pattern, string $subject)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public static function utf8(string $input, ?string $encoding = null)
* @param string $haystack
* @param string $needle
*
* @return \PhpOption\Option<int>
* @return \PhpOption\Option<int<0, max>>
*/
public static function pos(string $haystack, string $needle)
{
/** @var \PhpOption\Option<int> */
/** @var \PhpOption\Option<int<0, max>> */
return Option::fromValue(\mb_strpos($haystack, $needle, 0, 'UTF-8'), false);
}

Expand Down
Loading