Skip to content

Commit

Permalink
Use ::class
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneskod committed Dec 25, 2020
1 parent ea42198 commit aecbfbb
Show file tree
Hide file tree
Showing 45 changed files with 81 additions and 81 deletions.
4 changes: 2 additions & 2 deletions spec/Exception/TreeExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function let()

function it_is_initializable()
{
$this->shouldHaveType(TreeException::CLASS);
$this->shouldHaveType(TreeException::class);
}

function it_is_throwable()
{
$this->shouldHaveType(\Throwable::CLASS);
$this->shouldHaveType(\Throwable::class);
}

function it_contains_error_messages()
Expand Down
2 changes: 1 addition & 1 deletion spec/MessageRetrieverSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MessageRetrieverSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(MessageRetriever::CLASS);
$this->shouldHaveType(MessageRetriever::class);
}

function it_reads_message_from_single_id()
Expand Down
4 changes: 2 additions & 2 deletions spec/Money/SignalMoneyFormatterSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class SignalMoneyFormatterSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(SignalMoneyFormatter::CLASS);
$this->shouldHaveType(SignalMoneyFormatter::class);
}

function it_is_a_money_formatter()
{
$this->shouldHaveType(MoneyFormatter::CLASS);
$this->shouldHaveType(MoneyFormatter::class);
}

function it_fails_on_non_sek_money()
Expand Down
4 changes: 2 additions & 2 deletions spec/Money/SignalMoneyParserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class SignalMoneyParserSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(SignalMoneyParser::CLASS);
$this->shouldHaveType(SignalMoneyParser::class);
}

function it_is_a_money_parser()
{
$this->shouldHaveType(MoneyParser::CLASS);
$this->shouldHaveType(MoneyParser::class);
}

function it_fails_on_non_string()
Expand Down
6 changes: 3 additions & 3 deletions spec/Parser/ParserFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ class ParserFactorySpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(ParserFactory::CLASS);
$this->shouldHaveType(ParserFactory::class);
}

function it_creates_parsers()
{
$this->createParser()->shouldHaveType(ParserInterface::CLASS);
$this->createParser()->shouldHaveType(ParserInterface::class);
}

function it_creates_parses_with_no_external_visitors()
{
$this->createParser(ParserFactory::VISITOR_IGNORE_OBJECTS)->shouldHaveType(ParserInterface::CLASS);
$this->createParser(ParserFactory::VISITOR_IGNORE_OBJECTS)->shouldHaveType(ParserInterface::class);
}
}
6 changes: 3 additions & 3 deletions spec/Parser/ParserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ function let(Grammar $grammar, VisitorInterface $visitor)

function it_is_initializable()
{
$this->shouldHaveType(Parser::CLASS);
$this->shouldHaveType(Parser::class);
}

function it_is_a_parser()
{
$this->shouldHaveType(ParserInterface::CLASS);
$this->shouldHaveType(ParserInterface::class);
}

function it_creates_trees($grammar, $visitor, Node $node)
Expand All @@ -40,7 +40,7 @@ function it_creates_trees($grammar, $visitor, Node $node)
function it_throws_parser_exception_if_grammar_fails($grammar)
{
$grammar->parse('invalid-ag-file')->willThrow('\InvalidArgumentException');
$this->shouldThrow(ParserException::CLASS)->duringParse('invalid-ag-file');
$this->shouldThrow(ParserException::class)->duringParse('invalid-ag-file');
}

function it_converts_to_utf8($grammar, $visitor, Node $node)
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/AutogiroFileSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ function let()

function it_is_initializable()
{
$this->shouldHaveType(AutogiroFile::CLASS);
$this->shouldHaveType(AutogiroFile::class);
}

function it_is_a_container_node()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/ContainerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class ContainerSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_default_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/CountSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ function let(Node $count)

function it_is_initializable()
{
$this->shouldHaveType(Count::CLASS);
$this->shouldHaveType(Count::class);
}

function it_is_a_container()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/DateSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class DateSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Date::CLASS);
$this->shouldHaveType(Date::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/FlagSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ function let()

function it_is_initializable()
{
$this->shouldHaveType(Flag::CLASS);
$this->shouldHaveType(Flag::class);
}

function it_is_a_node()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/ImmediateDateSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class ImmediateDateSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(ImmediateDate::CLASS);
$this->shouldHaveType(ImmediateDate::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/MessageSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class MessageSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Message::CLASS);
$this->shouldHaveType(Message::class);
}

function it_is_a_container()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/NodeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NodeSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_name()
Expand Down Expand Up @@ -71,7 +71,7 @@ function it_can_have_children(Node $node)

function it_defaults_undefined_child_to_null_node()
{
$this->getChild('this-is-not-definied')->shouldHaveType(NullNode::CLASS);
$this->getChild('this-is-not-definied')->shouldHaveType(NullNode::class);
}

function it_identifies_child_nodes_insensitive_to_case(Node $node)
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/NullNodeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class NullNodeSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(NullNode::CLASS);
$this->shouldHaveType(NullNode::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/NumberSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class NumberSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Number::CLASS);
$this->shouldHaveType(Number::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_default_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/ObjSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class ObjSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Obj::CLASS);
$this->shouldHaveType(Obj::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_default_name()
Expand Down
2 changes: 1 addition & 1 deletion spec/Tree/RecordSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function let()

function it_is_initializable()
{
$this->shouldHaveType(Record::CLASS);
$this->shouldHaveType(Record::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/SectionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ function let(Record $nodeA, Record $nodeB)

function it_is_initializable()
{
$this->shouldHaveType(Section::CLASS);
$this->shouldHaveType(Section::class);
}

function it_is_a_container()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/SummarySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ function let(Node $amount)

function it_is_initializable()
{
$this->shouldHaveType(Summary::CLASS);
$this->shouldHaveType(Summary::class);
}

function it_is_a_container()
{
$this->shouldHaveType(Container::CLASS);
$this->shouldHaveType(Container::class);
}

function it_contains_a_name()
Expand Down
4 changes: 2 additions & 2 deletions spec/Tree/TextSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class TextSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Text::CLASS);
$this->shouldHaveType(Text::class);
}

function it_implements_node_interface()
{
$this->shouldHaveType(Node::CLASS);
$this->shouldHaveType(Node::class);
}

function it_contains_a_default_name()
Expand Down
6 changes: 3 additions & 3 deletions spec/Visitor/AccountVisitorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function let(

function it_is_initializable()
{
$this->shouldHaveType(AccountVisitor::CLASS);
$this->shouldHaveType(AccountVisitor::class);
}

function it_fails_on_unvalid_account_number(Node $node, $accountFactory, $errorObj)
Expand All @@ -36,7 +36,7 @@ function it_fails_on_unvalid_account_number(Node $node, $accountFactory, $errorO
$node->hasChild(Node::OBJ)->willReturn(false);

$node->getValueFrom(Node::NUMBER)->willReturn('not-valid');
$accountFactory->createAccount('not-valid')->willThrow(BankingException::CLASS);
$accountFactory->createAccount('not-valid')->willThrow(BankingException::class);

$this->beforeAccount($node);
$errorObj->addError(Argument::type('string'), Argument::cetera())->shouldHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -81,7 +81,7 @@ function it_fails_on_unvalid_bankgiro_number(Node $node, $bankgiroFactory, $erro
$node->hasChild(Node::OBJ)->willReturn(false);

$node->getValueFrom(Node::NUMBER)->willReturn('not-valid');
$bankgiroFactory->createAccount('not-valid')->willThrow(BankingException::CLASS);
$bankgiroFactory->createAccount('not-valid')->willThrow(BankingException::class);

$this->beforePayeeBankgiro($node);
$errorObj->addError(Argument::type('string'), Argument::cetera())->shouldHaveBeenCalledTimes(1);
Expand Down
2 changes: 1 addition & 1 deletion spec/Visitor/AmountVisitorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function let(ErrorObject $errorObj, MoneyParser $moneyParser)

function it_is_initializable()
{
$this->shouldHaveType(AmountVisitor::CLASS);
$this->shouldHaveType(AmountVisitor::class);
}

function it_does_not_create_amount_if_object_exists(Node $node)
Expand Down
2 changes: 1 addition & 1 deletion spec/Visitor/CountingVisitorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function let(ErrorObject $errorObj)

function it_is_initializable()
{
$this->shouldHaveType(CountingVisitor::CLASS);
$this->shouldHaveType(CountingVisitor::class);
}

function it_validates_record_counts(Node $count, Node $record, $errorObj)
Expand Down
2 changes: 1 addition & 1 deletion spec/Visitor/DateVisitorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function let(ErrorObject $errorObj)

function it_is_initializable()
{
$this->shouldHaveType(DateVisitor::CLASS);
$this->shouldHaveType(DateVisitor::class);
}

function it_does_not_create_if_date_object_exists(Node $node)
Expand Down
2 changes: 1 addition & 1 deletion spec/Visitor/ErrorObjectSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ErrorObjectSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(ErrorObject::CLASS);
$this->shouldHaveType(ErrorObject::class);
}

function it_defaults_to_no_error()
Expand Down
2 changes: 1 addition & 1 deletion spec/Visitor/MessageVisitorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function let(ErrorObject $errorObj, MessageRetriever $messages)

function it_is_initializable()
{
$this->shouldHaveType(MessageVisitor::CLASS);
$this->shouldHaveType(MessageVisitor::class);
}

function it_fails_on_unvalid_message(Node $file, Node $record, Node $msg, $errorObj, $messages)
Expand Down
Loading

0 comments on commit aecbfbb

Please sign in to comment.