Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename reserved keyword Match class to SRLMatch class #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 6 additions & 8 deletions src/Interfaces/TestMethodProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SRL\Interfaces;

use SRL\Exceptions\PregException;
use SRL\Match;
use SRL\SRLMatch;

/**
* Provider for methods that can be applied to the built regular expression by the user.
Expand Down Expand Up @@ -92,11 +92,10 @@ public function filter($replacement, $haystack, int $limit = -1, &$count = null)

/**
* Match regular expression against string and return all matches.
*
* @param string $string
* @param int $offset
* @throws PregException
* @return Match[]|array
* @return SRLMatch[]|array
*@throws PregException
*/
public function getMatches(string $string, int $offset = 0) : array
{
Expand All @@ -107,19 +106,18 @@ public function getMatches(string $string, int $offset = 0) : array
$matchObjects = [];

foreach ($matches as $match) {
$matchObjects[] = new Match($match);
$matchObjects[] = new SRLMatch($match);
}

return $matchObjects;
}

/**
* Match regular expression against string and return first match object.
*
* @param string $string
* @param int $offset
* @throws PregException
* @return null|Match
* @return null|SRLMatch
*@throws PregException
*/
public function getMatch(string $string, int $offset = 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Match.php → src/SRLMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SRL;

class Match
class SRLMatch
{
/** @var string[] */
protected $rawData = [];
Expand Down