@return array

@throws IsbnException If this ISBN is not in a recognized group or range.
767191
public function getParts() : array
    {
        if ($this->rangeInfo === null) {
            throw IsbnException::unknownGroup($this->isbn);
        }

        if ($this->rangeInfo->parts === null) {
            throw IsbnException::unknownRange($this->isbn);
        }

        return $this->rangeInfo->parts;
    }
707600
private function validateIsbn10(): bool
    {
        $value = \str_replace(['-', ' '], '', $this->value);
        if (!\preg_match($this->patterns['isbn10-basic'], $value)) {
            $this->setError(self::VALIDATOR_ERROR_ISBN_INCORRECT_FORMAT);
            return false;
        }

        $sum = 0;
        for ($i = 0; $i < 9; $i++) {
            $sum += (10 - $i) * $value{$i};
        }

        $checksum = 11 - ($sum % 11);
        if ($checksum == 11) {
            $checksum = '0';
        } elseif ($checksum == 10) {
            $checksum = 'X';
        }
        $isValid = \substr($value, -1) == $checksum ? true : false;
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_ISBN_INVALID_NUMBER);
        }
        return $isValid;
    }
71623
public function format($format = 'EAN')
    {
        if (!$this->isValid()) {
            throw new \Exception('Cannot format invalid ISBN: '.$this->getErrors());
        }

        $this->calculateChecksum($format);

        $A = $this->getProduct();
        $B = $this->getCountry();
        $C = $this->getPublisher();
        $D = $this->getPublication();
        $E = $this->getChecksum();

        if ($format == 'ISBN-10') {
            return $B.'-'.$C.'-'.$D.'-'.$E;
        } elseif ($format == 'ISBN-13' || $format == 'ISBN') {
            return $A.'-'.$B.'-'.$C.'-'.$D.'-'.$E;
        } else {
            return $A.$B.$C.$D.$E;
        }
    }
210059
public static function withCheckDigitForIsbn10($isbn)
    {
        // Sanitize
        $isbn = preg_replace('/[^0-9]/', '', $isbn);
        $isbn = substr($isbn, 0, 9);

        // Validate
        if (strlen($isbn) != 9) {
            return null;
        }

        // Calculate (sum)
        $sum = 0;
        for ($i = 0; $i < 9; $i++) {
            $sum += (10 - $i) * $isbn{$i};
        }

        // Calculate (check digit)
        $checkDigit = 11 - ($sum % 11);
        $checkDigit = $checkDigit == 10 ? "X" : ($checkDigit == 11 ? 0 : $checkDigit);

        return $isbn . $checkDigit;
    }
111630
public function getAsGroupedArray(): array
    {
        $result = array();

        foreach ($this->_groups as $groupName => $memberKeys) {
            $members = array();

            foreach ($memberKeys as $key) {
                $members[$key] = $this->getFieldAsArray($key);
            }

            $result[$groupName] = array(
                'group_name' => $groupName,
                'group_caption' => $this->_('group_' . $groupName),
                'fields' => $members
            );
        }

        return $result;
    }
392551
public function toOptionArray()
    {
        return [
            [
                'value' => \Dotdigitalgroup\Email\Model\Sync\Catalog\CatalogSyncFactory::SYNC_CATALOG_DEFAULT_LEVEL,
                'label' => 'Default Level',
            ],
            [
                'value' => \Dotdigitalgroup\Email\Model\Sync\Catalog\CatalogSyncFactory::SYNC_CATALOG_STORE_LEVEL,
                'label' => 'Store Level',
            ],
        ];
    }
1361876
public function getRange()
    {
        /** @var Range $constraint */
        if ($constraint = $this->docBlockUtility->getConstraint($this->property, Range::class)) {
            return [
                'min' => $constraint->min,
                'max' => $constraint->max,
            ];
        }
    }
827665
public function identify($isbn)
    {
        if($this->is10($isbn) === true) {
            return 10;
        }
        
        return ($this->is13($isbn) === true ? 13 : false);
    }
260128
public function isbn($isbn)
    {
        if ($this->check->is13($isbn))
            return $this->isbn13($isbn);
        if ($this->check->is10($isbn))
            return $this->isbn10($isbn);
        return false;
    }
735222
public function getExcluded(): array
    {
        $arr = [];
        foreach ($this->columns as $name => $column) {
            if ($column->isExcluded()) {
                $arr[] = $name;
            }
        }

        return $arr;
    }
643123
protected function getReadOnlyTraitHooks(): array
	{
		return
		[
			'beforeInsert' =>
			[
				function($values, $query): void
				{
					throw new ReadOnlyException('Attempted to create a read-only record.');
				},
			],
			'beforeUpdate' =>
			[
				function($values, $query): void
				{
					throw new ReadOnlyException('Attempted to update a read-only record.');
				},
			],
			'beforeDelete' =>
			[
				function($query): void
				{
					throw new ReadOnlyException('Attempted to delete a read-only record.');
				},
			],
		];
	}
35957
public function getAddressBooks()
    {
        $website = $this->helper->getWebsite();
        $client = $this->helper->getWebsiteApiClient($website);

        $savedAddressBooks = $this->registry->registry('addressbooks');
        //get saved address books from registry
        if ($savedAddressBooks) {
            $addressBooks = $savedAddressBooks;
        } else {
            // api all address books
            $addressBooks = $client->getAddressBooks();
            $this->registry->unregister('addressbooks'); // additional measure
            $this->registry->register('addressbooks', $addressBooks);
        }

        return $addressBooks;
    }
632513
public static function checkIsbn13Number($isbn)
    {
        $isbn = trim($isbn);
        if (mb_strlen($isbn) !== 13 || preg_match('/0{13}/', $isbn)) {
            throw new MsgException("ISBN13 형식에 맞지 않습니다.");
        }

        if (!is_numeric($isbn)) {
            throw new MsgException('ISBN13 형식에 맞지 않습니다.');
        }

        $total = 0;

        for ($i = 0; $i < 12; $i++) {
            $digit = intval(substr($isbn, $i, 1));
            $total += ($i % 2 === 0) ? $digit : $digit * 3;
        }

        $check_sum = 10 - ($total % 10);
        if ($check_sum === 10) {
            $check_sum = 0;
        }

        if ($check_sum !== intval(substr($isbn, -1))) {
            throw new MsgException("ISBN13 형식에 맞지 않습니다.");
        }
    }
199725
def get_epublication(self):
        
        if not self.is_valid():
            bad_fields = filter(lambda x: not x.is_valid(), self.fields)
            bad_fields = map(
                lambda x: "Keyword '%s' (%s) not found." % (x.keyword, x.descr),
                bad_fields
            )

            raise MetaParsingException(
                "Missing field(s):\n\t" + "\n\t".join(bad_fields)
            )

        relevant_fields = self.fields
        relevant_fields += filter(lambda x: x.is_valid(), self.optional)

        epub_dict = dict(map(lambda x: (x.epub, x.value), relevant_fields))

        # make sure, that all fields present in EPublication has values also
        # in epub_dict
        for epublication_part in EPublication._fields:
            if epublication_part not in epub_dict:
                epub_dict[epublication_part] = None

        if not is_valid_isbn(epub_dict["ISBN"]):
            raise MetaParsingException(
                "ISBN '%s' is not valid!" % epub_dict["ISBN"]
            )

        return EPublication(**epub_dict)
206340
public function getOrderTableDescription()
    {
        $salesTable = $this->adapter->getTableName('sales_order');
        $adapter = $this->adapter->getConnection('sales');
        $columns = $adapter->describeTable($salesTable);

        return $columns;
    }
911100
public function is10($isbn)
    {
        if(is_string($isbn) === false) {
            throw new Exception('Invalid parameter type.');
        }

        $isbn = $this->hyphens->removeHyphens($isbn);
        return (strlen($isbn) === 10);
    }
687764
public function getPluginsWithPressbooksInDescription() {
		$plugins = get_plugins();
		$matches = [];
		foreach ( $plugins as $file => $plugin ) {
			if ( $plugin['Name'] === 'Pressbooks' ) {
				continue; // Fix Pluginception...
			}
			if ( stristr( $plugin['Name'], 'pressbooks' ) || stristr( $plugin['Description'], 'pressbooks' ) || stristr( $file, 'pressbooks' ) ) {
				$matches[ $file ] = $plugin;
			}
		}
		return $matches;
	}