Skip to content

Commit f016fd5

Browse files
committed
add @throws declarations
try the simplest way of doing it fist also, regenerated docs for 8.6 see #62
1 parent fc415b0 commit f016fd5

File tree

7 files changed

+478
-49
lines changed

7 files changed

+478
-49
lines changed

examples/generate_phpdoc.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
# ../examples/generate_phpdoc.rb
1313

1414
# this needs version 1.x of ruby-vips
15+
#
16+
# gem install ruby-vips -v 1.0.6
1517

1618
# gobject-introspection 3.0.7 crashes a lot if it GCs while doing
1719
# something
1820
GC.disable
1921

20-
Vips::init
22+
Vips::init("")
2123

2224
# these have hand-written methods, don't autodoc them
2325
$no_generate = %w(
@@ -208,6 +210,8 @@ def generate_operation(file, op)
208210
end
209211
file << " * ];\n"
210212
end
213+
214+
file << " * @throws Exception\n"
211215
end
212216

213217
def generate_class(file, gtype)

src/BlendMode.php

+8-42
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ abstract class BlendMode
5656
const OUT = 'out';
5757
const ATOP = 'atop';
5858
const DEST = 'dest';
59-
const DEST_OVER = 'dest_over';
60-
const DEST_IN = 'dest_in';
61-
const DEST_OUT = 'dest_out';
62-
const DEST_ATOP = 'dest_atop';
59+
const DEST_OVER = 'dest-over';
60+
const DEST_IN = 'dest-in';
61+
const DEST_OUT = 'dest-out';
62+
const DEST_ATOP = 'dest-atop';
6363
const XOR = 'xor';
6464
const ADD = 'add';
6565
const SATURATE = 'saturate';
@@ -68,44 +68,10 @@ abstract class BlendMode
6868
const OVERLAY = 'overlay';
6969
const DARKEN = 'darken';
7070
const LIGHTEN = 'lighten';
71-
const COLOUR_DOFGE = 'colour_dodge';
72-
const COLOUR_BURN = 'colour_burn';
73-
const HARD_LIGHT = 'hard_light';
74-
const SOFT_LIGHT = 'soft_light';
71+
const COLOUR_DODGE = 'colour-dodge';
72+
const COLOUR_BURN = 'colour-burn';
73+
const HARD_LIGHT = 'hard-light';
74+
const SOFT_LIGHT = 'soft-light';
7575
const DIFFERENCE = 'difference';
7676
const EXCLUSION = 'exclusion';
77-
78-
/* combine takes an array of blend modes, passed to libvips as an array of
79-
* int. Because libvips does now know they should be enums, we have to do
80-
* the string->int conversion ourselves. We ought to introspect to find the
81-
* mapping, but until we have the machinery for that, we just hardwire the
82-
* mapping here.
83-
*/
84-
const TO_INT = [
85-
BlendMode::CLEAR => 0,
86-
BlendMode::SOURCE => 1,
87-
BlendMode::OVER => 2,
88-
BlendMode::IN => 3,
89-
BlendMode::OUT => 4,
90-
BlendMode::ATOP => 5,
91-
BlendMode::DEST => 6,
92-
BlendMode::DEST_OVER => 7,
93-
BlendMode::DEST_IN => 8,
94-
BlendMode::DEST_OUT => 9,
95-
BlendMode::DEST_ATOP => 10,
96-
BlendMode::XOR => 11,
97-
BlendMode::ADD => 12,
98-
BlendMode::SATURATE => 13,
99-
BlendMode::MULTIPLY => 14,
100-
BlendMode::SCREEN => 15,
101-
BlendMode::OVERLAY => 16,
102-
BlendMode::DARKEN => 17,
103-
BlendMode::LIGHTEN => 18,
104-
BlendMode::COLOUR_DOFGE => 19,
105-
BlendMode::COLOUR_BURN => 20,
106-
BlendMode::HARD_LIGHT => 21,
107-
BlendMode::SOFT_LIGHT => 22,
108-
BlendMode::DIFFERENCE => 23,
109-
BlendMode::EXCLUSION => 24
110-
];
11177
}

src/Combine.php

+1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ abstract class Combine
5151
{
5252
const MAX = 'max';
5353
const SUM = 'sum';
54+
const MIN = 'min';
5455
}

src/CompassDirection.php

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
/**
4+
* This file was generated automatically. Do not edit!
5+
*
6+
* PHP version 7
7+
*
8+
* LICENSE:
9+
*
10+
* Copyright (c) 2016 John Cupitt
11+
*
12+
* Permission is hereby granted, free of charge, to any person obtaining
13+
* a copy of this software and associated documentation files (the
14+
* "Software"), to deal in the Software without restriction, including
15+
* without limitation the rights to use, copy, modify, merge, publish,
16+
* distribute, sublicense, and/or sell copies of the Software, and to
17+
* permit persons to whom the Software is furnished to do so, subject to
18+
* the following conditions:
19+
*
20+
* The above copyright notice and this permission notice shall be
21+
* included in all copies or substantial portions of the Software.
22+
*
23+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30+
*
31+
* @category Images
32+
* @package Jcupitt\Vips
33+
* @author John Cupitt <jcupitt@gmail.com>
34+
* @copyright 2016 John Cupitt
35+
* @license https://opensource.org/licenses/MIT MIT
36+
* @link https://github.com/jcupitt/php-vips
37+
*/
38+
39+
namespace Jcupitt\Vips;
40+
41+
/**
42+
* The CompassDirection enum.
43+
* @category Images
44+
* @package Jcupitt\Vips
45+
* @author John Cupitt <jcupitt@gmail.com>
46+
* @copyright 2016 John Cupitt
47+
* @license https://opensource.org/licenses/MIT MIT
48+
* @link https://github.com/jcupitt/php-vips
49+
*/
50+
abstract class CompassDirection
51+
{
52+
const CENTRE = 'centre';
53+
const NORTH = 'north';
54+
const EAST = 'east';
55+
const SOUTH = 'south';
56+
const WEST = 'west';
57+
const NORTH_EAST = 'north-east';
58+
const SOUTH_EAST = 'south-east';
59+
const SOUTH_WEST = 'south-west';
60+
const NORTH_WEST = 'north-west';
61+
}

0 commit comments

Comments
 (0)