Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / lsolesen / pel / src / PelWrongComponentCountException.php
1 <?php
2
3 /**
4  * PEL: PHP Exif Library.
5  * A library with support for reading and
6  * writing all Exif headers in JPEG and TIFF images using PHP.
7  *
8  * Copyright (C) 2004, 2005, 2006 Martin Geisler.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program in the file COPYING; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301 USA
24  */
25 namespace lsolesen\pel;
26
27 /**
28  * Classes for dealing with Exif entries.
29  *
30  * This file defines two exception classes and the abstract class
31  * {@link PelEntry} which provides the basic methods that all Exif
32  * entries will have. All Exif entries will be represented by
33  * descendants of the {@link PelEntry} class --- the class itself is
34  * abstract and so it cannot be instantiated.
35  *
36  * @author Martin Geisler <mgeisler@users.sourceforge.net>
37  * @license http://www.gnu.org/licenses/gpl.html GNU General Public
38  *          License (GPL)
39  * @package PEL
40  */
41 use lsolesen\pel\PelTag;
42
43 /**
44  * Exception indicating that an unexpected number of components was
45  * found.
46  *
47  * Some tags have strict limits as to the allowed number of
48  * components, and this exception is thrown if the data violates such
49  * a constraint. The documentation for each tag in {@link PelTag}
50  * explains the expected number of components.
51  *
52  * @author Martin Geisler <mgeisler@users.sourceforge.net>
53  * @package PEL
54  * @subpackage Exception
55  */
56 class PelWrongComponentCountException extends \lsolesen\pel\PelEntryException
57 {
58
59     /**
60      * Construct a new exception indicating a wrong number of
61      * components.
62      *
63      * @param int $type
64      *            the type of IFD.
65      *
66      * @param PelTag $tag
67      *            the tag for which the violation was found.
68      *
69      * @param int $found
70      *            the number of components found.
71      *
72      * @param int $expected
73      *            the expected number of components.
74      */
75     public function __construct($type, $tag, $found, $expected)
76     {
77         parent::__construct('Wrong number of components found for %s tag: %d. ' . 'Expected %d.', PelTag::getName($type, $tag), $found, $expected);
78         $this->tag = $tag;
79         $this->type = $type;
80     }
81 }