Skip to content

Commit 9336cf3

Browse files
committed
[BC break] Make constants name shorter
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent 3c86b71 commit 9336cf3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/SequenceMatcher.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
final class SequenceMatcher
1515
{
1616
// people may prefer this for debugging
17-
const OPCODE_EQUAL = 'eq';
18-
const OPCODE_DELETE = 'del';
19-
const OPCODE_INSERT = 'ins';
20-
const OPCODE_REPLACE = 'rep';
17+
const OP_EQ = 'eq';
18+
const OP_DEL = 'del';
19+
const OP_INS = 'ins';
20+
const OP_REP = 'rep';
2121

2222
// people may prefer this for bit operations
23-
const OPCODE_INT_EQUAL = 1 << 0;
24-
const OPCODE_INT_DELETE = 1 << 1;
25-
const OPCODE_INT_INSERT = 1 << 2;
26-
const OPCODE_INT_REPLACE = 1 << 3;
23+
const OP_INT_EQ = 1 << 0;
24+
const OP_INT_DEL = 1 << 1;
25+
const OP_INT_INS = 1 << 2;
26+
const OP_INT_REP = 1 << 3;
2727

2828
/**
2929
* @var null|callable either a string or an array containing a callback function to determine if a line is "junk" or not
@@ -583,17 +583,17 @@ private function setOps(bool $useIntOpcodes): self
583583
{
584584
if ($useIntOpcodes) {
585585
$this->ops = [
586-
'del' => self::OPCODE_INT_DELETE,
587-
'eq' => self::OPCODE_INT_EQUAL,
588-
'ins' => self::OPCODE_INT_INSERT,
589-
'rep' => self::OPCODE_INT_REPLACE,
586+
'del' => self::OP_INT_DEL,
587+
'eq' => self::OP_INT_EQ,
588+
'ins' => self::OP_INT_INS,
589+
'rep' => self::OP_INT_REP,
590590
];
591591
} else {
592592
$this->ops = [
593-
'del' => self::OPCODE_DELETE,
594-
'eq' => self::OPCODE_EQUAL,
595-
'ins' => self::OPCODE_INSERT,
596-
'rep' => self::OPCODE_REPLACE,
593+
'del' => self::OP_DEL,
594+
'eq' => self::OP_EQ,
595+
'ins' => self::OP_INS,
596+
'rep' => self::OP_REP,
597597
];
598598
}
599599

0 commit comments

Comments
 (0)