Source of file AbstractFragment.php

Size: 5,057 Bytes - Last Modified: 2019-05-10T12:24:09+01:00

src/Utility/Fragment/AbstractFragment.php

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
Covered by 10 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanBeConstructedForValidConstructorArguments
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanBeConstructedForInvalidConstructorArguments
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
50
Covered by 1 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanBeConstructedForInvalidConstructorArguments
515253
Covered by 9 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanBeConstructedForValidConstructorArguments
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
54
Covered by 9 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanBeConstructedForValidConstructorArguments
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
5556575859606162
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
63
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
6465
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
6667
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
68
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
6970
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
71
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
72
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
737475
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
76
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
77
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
78
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
79808182
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
8384
Covered by 1 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
85
Covered by 1 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
8687
Covered by 1 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
88
Covered by 1 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
89
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
9091
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
92
Covered by 3 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
93
Covered by 3 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
9495
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
96
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
97
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
9899
Covered by 4 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
100101102103104
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
105
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
106
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
107
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
108
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
109
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
110111
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
112113114115116
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
117
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
118
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
119
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
120
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
121
Covered by 2 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
122
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
123124
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
125126127128129130131132133134
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
135136137138139140141142143144
Covered by 7 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
145146147148149150151152153154155156
Covered by 3 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
157
Covered by 3 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
158159160161162163164165
Covered by 6 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
166167168169170171172173174175176177178179
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
180
Covered by 8 test(s):
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsA
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsC
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsX
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsY
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetIonsZ
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsB
  • pgb_liv\php_ms\Test\Unit\FragmentTest::testObjectCanGetModifiedIonsY
181182183
<?php
/**
 * Copyright 2018 University of Liverpool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace pgb_liv\php_ms\Utility\Fragment;

use pgb_liv\php_ms\Core\AminoAcidMono;
use pgb_liv\php_ms\Core\ModifiableSequenceInterface;
use pgb_liv\php_ms\Constant\PhysicalConstants;

/**
 * Abstract class containing generic filtering methods
 *
 * @author Andrew Collins
 */
abstract class AbstractFragment implements FragmentInterface
{

    /**
     * Whether the fragments should be read right-left or left-right
     *
     * @var bool
     */
    private $isReversed = false;

    protected $sequence;

    /**
     * Creates a new instance of this fragmenter using the specified peptide
     *
     * @param ModifiableSequenceInterface $sequence
     *            Peptide object which must contain a sequence
     * @throws \InvalidArgumentException If the peptide object does not contain a sequence
     */
    public function __construct(ModifiableSequenceInterface $sequence)
    {
        if (is_null($sequence->getSequence()) || strlen($sequence->getSequence()) == 0) {
            throw new \InvalidArgumentException('Null or empty sequence received.');
        }

        $this->sequence = $sequence;
    }

    /**
     *
     * {@inheritdoc}
     */
    public function getIons($charge = 1)
    {
        $ions = array();
        $sequenceString = $this->sequence->getSequence();

        $sum = 0;

        $cTermMass = $this->getCTerminalMass();
        $nTermMass = $this->getNTerminalMass();

        for ($i = $this->getStart(); $i < $this->getEnd(); $i ++) {
            $residue = $sequenceString[$i];
            $mass = AminoAcidMono::getMonoisotopicMass($residue);

            // Add mass
            if ($i == 0) {
                $mass += $this->getAdditiveMass();
                $mass += $nTermMass;
            }

            // Add modification mass
            // Catch modification on position or residue
            foreach ($this->sequence->getModifications() as $modification) {
                // Check every position or residue
                if ($modification->getLocation() === $i + 1 ||
                    (is_null($modification->getLocation()) && in_array($residue, $modification->getResidues()))) {
                    // Residue is modified
                    $mass += $modification->getMonoisotopicMass();
                }
            }

            if ($i + 1 == $this->sequence->getLength()) {
                $mass += $cTermMass;
            }

            $sum += $mass;
            $ions[$i + 1] = $this->getChargedIon($sum, $charge);
        }

        return $ions;
    }

    protected function getNTerminalMass()
    {
        $mass = 0;
        foreach ($this->sequence->getModifications() as $modification) {
            if ($modification->getLocation() === 0 || in_array('[', $modification->getResidues())) {
                $mass += $modification->getMonoisotopicMass();
            }
        }

        return $mass;
    }

    protected function getCTerminalMass()
    {
        $mass = 0;
        foreach ($this->sequence->getModifications() as $modification) {
            if ($modification->getLocation() === $this->sequence->getLength() + 1 ||
                in_array(']', $modification->getResidues())) {
                $mass += $modification->getMonoisotopicMass();
            }
        }

        return $mass;
    }

    /**
     * Gets the end position of the detectable fragments
     *
     * @return int
     */
    protected function getEnd()
    {
        return $this->sequence->getLength();
    }

    /**
     * Gets the start position of the detectable fragments
     *
     * @return int
     */
    protected function getStart()
    {
        return 0;
    }

    /**
     * Gets the additional mass gained in fragmentation
     *
     * @return double
     */
    abstract protected function getAdditiveMass();

    protected function setIsReversed($bool)
    {
        $this->isReversed = $bool;
    }

    /**
     *
     * {@inheritdoc}
     */
    public function isReversed()
    {
        return $this->isReversed;
    }

    /**
     * Charges the mass to the specified charge
     *
     * @param double $mass
     *            The neutral mass to charge
     * @param int $charge
     *            The integer charge value to charge too
     * @return double
     */
    protected function getChargedIon($mass, $charge)
    {
        $chargedMass = $mass + (PhysicalConstants::PROTON_MASS * $charge);
        return $chargedMass / $charge;
    }
}