-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds bot-parsers as injectionable objects (#5712)
* Adds bot-parsers as injectionable objects Handles the botparser equivalent to the client/device parsers. This way users of the library can add their own botparser that might not be usefull for the library, but are needed in their own situation. As there does not seem to be any usecase for adding multple bot-parsers in this project, there is no separte directory with bot-parsers, nor can we add a botparser by string. * Adds botparserabstract to implement discarDetails Re-adds the discardDetails() that accidently got removed in the refactor. To be able to do this on all added bots, an abstract is created. It could have been an interface, but all other (client, device) do this with an abstract, so that pattern is followed Adds a test that catches the problem in previous commit, and passes now
- Loading branch information
1 parent
bade470
commit 25e11d1
Showing
4 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Device Detector - The Universal Device Detection library for parsing User Agents | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later | ||
*/ | ||
namespace DeviceDetector\Parser; | ||
|
||
/** | ||
* Class BotParserAbstract | ||
* | ||
* Abstract class for all bot parsers | ||
* | ||
* @package DeviceDetector\Parser | ||
*/ | ||
abstract class BotParserAbstract extends ParserAbstract | ||
{ | ||
/** | ||
* Enables information discarding | ||
*/ | ||
abstract public function discardDetails(); | ||
} |
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