2 # Add PHP type hints for classes.
4 # Copyright (C) 2011,2012,2017 Olly Betts
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to
8 # deal in the Software without restriction, including without limitation the
9 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 # sell copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29 if (/^(?:abstract )?class (\w+)/) {
35 if (s/(function equals\()(\$o\))/$1$current_class $2/) {
37 } elsif (s/(function unserialise\(.*)(\$registry\b)/$1XapianRegistry $2/) {
39 } elsif (s/(function set_stemmer\()(\$stem)/$1XapianStem $2/) {
41 } elsif (s/(function set_stopper\()(\$stop)/$1XapianStopper $2/) {
43 } elsif (s/(function (?:set|add)_document\()(\$doc)/$1XapianDocument $2/) {
45 } elsif (s/(function replace_document\(.*)(\$doc)/$1XapianDocument $2/) {
47 } elsif (s/(function (?:set|add)_database\()(\$d)/$1XapianDatabase $2/) {
49 # This would break existing subclasses as the signature must match.
50 # } elsif (s/(function apply\()(\$doc)/$1XapianDocument $2/) {
52 } elsif (s/(function set_query\()(\$query\b)/$1XapianQuery $2/) {
54 } elsif (s/(function add_matchspy\()(\$spy\b)/$1XapianMatchSpy $2/) {
56 } elsif (s/(function set_weighting_scheme\()(\$weight)/$1XapianWeight $2/) {
58 } elsif (s/(function set_sort\w+\()(\$sorter\b)/$1XapianKeyMaker $2/) {
60 } elsif (s/(function get_mset\(.*)(\$mdecider\b)/$1XapianMatchDecider $2/) {
62 } elsif (s/(function get_eset\(.*)(\$edecider\b)/$1XapianExpandDecider $2/) {
63 s/(function get_eset\(.*)(\$(?:om)?rset\b)/$1XapianRSet $2/;
65 } elsif (s/(function add_rangeprocessor\()(\$r)/$1XapianRangeProcessor $2/) {
67 } elsif (s/(function add_valuerangeprocessor\()(\$v)/$1XapianValueRangeProcessor $2/) {
69 } elsif (s/(function register_weighting_scheme\()(\$w)/$1XapianWeight $2/) {
71 } elsif (s/(function register_posting_source\()(\$)/$1XapianPostingSource $2/) {
73 } elsif (s/(function register_match_spy\()(\$)/$1XapianMatchSpy $2/) {
75 } elsif (s/(function init\()(\$d(?:b|atabase))/$1XapianDatabase $2/) {