This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch enhance/go-mod
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git

commit 8e9b708f5176325accb7f2d5813be25dac2c1ff7
Author: kezhenxu94 <[email protected]>
AuthorDate: Thu Jul 22 17:11:08 2021 +0800

    Enhance Go dependency resolver to resolve built-in and non-standard Go 
modules
---
 assets/lcs-templates/BSD-2-Clause.txt |  16 ++
 assets/lcs-templates/ISC.txt          |   5 +
 assets/lcs-templates/MPL-2.0.txt      | 362 ++++++++++++++++++++++++++++++++++
 assets/styles.yaml                    |   9 +
 commands/deps_resolve.go              |   4 +-
 go.mod                                |   4 +-
 go.sum                                |  23 ++-
 pkg/deps/golang.go                    | 107 +++-------
 pkg/license/identifier.go             |   5 +-
 pkg/license/norm.go                   |  92 +++++++--
 test.go                               |  36 ++++
 test.php                              |  29 +++
 12 files changed, 591 insertions(+), 101 deletions(-)

diff --git a/assets/lcs-templates/BSD-2-Clause.txt 
b/assets/lcs-templates/BSD-2-Clause.txt
new file mode 100644
index 0000000..593eadb
--- /dev/null
+++ b/assets/lcs-templates/BSD-2-Clause.txt
@@ -0,0 +1,16 @@
+Copyright (c) <year> <owner>. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the 
distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/assets/lcs-templates/ISC.txt b/assets/lcs-templates/ISC.txt
new file mode 100644
index 0000000..c08cff2
--- /dev/null
+++ b/assets/lcs-templates/ISC.txt
@@ -0,0 +1,5 @@
+Copyright [year] [owner]
+
+Permission to use, copy, modify, and/or distribute this software for any 
purpose with or without fee is hereby granted, provided that the above 
copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
PERFORMANCE OF THIS SOFTWARE.
diff --git a/assets/lcs-templates/MPL-2.0.txt b/assets/lcs-templates/MPL-2.0.txt
new file mode 100644
index 0000000..56b81fa
--- /dev/null
+++ b/assets/lcs-templates/MPL-2.0.txt
@@ -0,0 +1,362 @@
+mozilla public license, version 2.0
+
+1. definitions
+
+1.1. "contributor"
+
+     means each individual or legal entity that creates, contributes to the
+     creation of, or owns covered software.
+
+1.2. "contributor version"
+
+     means the combination of the contributions of others (if any) used by a
+     contributor and that particular contributor's contribution.
+
+1.3. "contribution"
+
+     means covered software of a particular contributor.
+
+1.4. "covered software"
+
+     means source code form to which the initial contributor has attached the
+     notice in exhibit a, the executable form of such source code form, and
+     modifications of such source code form, in each case including portions
+     thereof.
+
+1.5. "incompatible with secondary licenses"
+     means
+
+     a. that the initial contributor has attached the notice described in
+        exhibit b to the covered software; or
+
+     b. that the covered software was made available under the terms of
+        version 1.1 or earlier of the license, but not also under the terms of
+        a secondary license.
+
+1.6. "executable form"
+
+     means any form of the work other than source code form.
+
+1.7. "larger work"
+
+     means a work that combines covered software with other material, in a
+     separate file or files, that is not covered software.
+
+1.8. "license"
+
+     means this document.
+
+1.9. "licensable"
+
+     means having the right to grant, to the maximum extent possible, whether
+     at the time of the initial grant or subsequently, any and all of the
+     rights conveyed by this license.
+
+1.10. "modifications"
+
+     means any of the following:
+
+     a. any file in source code form that results from an addition to,
+        deletion from, or modification of the contents of covered software; or
+
+     b. any new file in source code form that contains any covered software.
+
+1.11. "patent claims" of a contributor
+
+      means any patent claim(s), including without limitation, method,
+      process, and apparatus claims, in any patent licensable by such
+      contributor that would be infringed, but for the grant of the license,
+      by the making, using, selling, offering for sale, having made, import,
+      or transfer of either its contributions or its contributor version.
+
+1.12. "secondary license"
+
+      means either the gnu general public license, version 2.0, the gnu lesser
+      general public license, version 2.1, the gnu affero general public
+      license, version 3.0, or any later versions of those licenses.
+
+1.13. "source code form"
+
+      means the form of the work preferred for making modifications.
+
+1.14. "you" (or "your")
+
+      means an individual or a legal entity exercising rights under this
+      license. for legal entities, "you" includes any entity that controls, is
+      controlled by, or is under common control with you. for purposes of this
+      definition, "control" means (a) the power, direct or indirect, to cause
+      the direction or management of such entity, whether by contract or
+      otherwise, or (b) ownership of more than fifty percent (50%) of the
+      outstanding shares or beneficial ownership of such entity.
+
+
+2. license grants and conditions
+
+2.1. grants
+
+     each contributor hereby grants you a world-wide, royalty-free,
+     non-exclusive license:
+
+     a. under intellectual property rights (other than patent or trademark)
+        licensable by such contributor to use, reproduce, make available,
+        modify, display, perform, distribute, and otherwise exploit its
+        contributions, either on an unmodified basis, with modifications, or
+        as part of a larger work; and
+
+     b. under patent claims of such contributor to make, use, sell, offer for
+        sale, have made, import, and otherwise transfer either its
+        contributions or its contributor version.
+
+2.2. effective date
+
+     the licenses granted in section 2.1 with respect to any contribution
+     become effective for each contribution on the date the contributor first
+     distributes such contribution.
+
+2.3. limitations on grant scope
+
+     the licenses granted in this section 2 are the only rights granted under
+     this license. no additional rights or licenses will be implied from the
+     distribution or licensing of covered software under this license.
+     notwithstanding section 2.1(b) above, no patent license is granted by a
+     contributor:
+
+     a. for any code that a contributor has removed from covered software; or
+
+     b. for infringements caused by: (i) your and any other third party's
+        modifications of covered software, or (ii) the combination of its
+        contributions with other software (except as part of its contributor
+        version); or
+
+     c. under patent claims infringed by covered software in the absence of
+        its contributions.
+
+     this license does not grant any rights in the trademarks, service marks,
+     or logos of any contributor (except as may be necessary to comply with
+     the notice requirements in section 3.4).
+
+2.4. subsequent licenses
+
+     no contributor makes additional grants as a result of your choice to
+     distribute the covered software under a subsequent version of this
+     license (see section 10.2) or under the terms of a secondary license (if
+     permitted under the terms of section 3.3).
+
+2.5. representation
+
+     each contributor represents that the contributor believes its
+     contributions are its original creation(s) or it has sufficient rights to
+     grant the rights to its contributions conveyed by this license.
+
+2.6. fair use
+
+     this license is not intended to limit any rights you have under
+     applicable copyright doctrines of fair use, fair dealing, or other
+     equivalents.
+
+2.7. conditions
+
+     sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
+     section 2.1.
+
+
+3. responsibilities
+
+3.1. distribution of source form
+
+     all distribution of covered software in source code form, including any
+     modifications that you create or to which you contribute, must be under
+     the terms of this license. you must inform recipients that the source
+     code form of the covered software is governed by the terms of this
+     license, and how they can obtain a copy of this license. you may not
+     attempt to alter or restrict the recipients' rights in the source code
+     form.
+
+3.2. distribution of executable form
+
+     if you distribute covered software in executable form then:
+
+     a. such covered software must also be made available in source code form,
+        as described in section 3.1, and you must inform recipients of the
+        executable form how they can obtain a copy of such source code form by
+        reasonable means in a timely manner, at a charge no more than the cost
+        of distribution to the recipient; and
+
+     b. you may distribute such executable form under the terms of this
+        license, or sublicense it under different terms, provided that the
+        license for the executable form does not attempt to limit or alter the
+        recipients' rights in the source code form under this license.
+
+3.3. distribution of a larger work
+
+     you may create and distribute a larger work under terms of your choice,
+     provided that you also comply with the requirements of this license for
+     the covered software. if the larger work is a combination of covered
+     software with a work governed by one or more secondary licenses, and the
+     covered software is not incompatible with secondary licenses, this
+     license permits you to additionally distribute such covered software
+     under the terms of such secondary license(s), so that the recipient of
+     the larger work may, at their option, further distribute the covered
+     software under the terms of either this license or such secondary
+     license(s).
+
+3.4. notices
+
+     you may not remove or alter the substance of any license notices
+     (including copyright notices, patent notices, disclaimers of warranty, or
+     limitations of liability) contained within the source code form of the
+     covered software, except that you may alter any license notices to the
+     extent required to remedy known factual inaccuracies.
+
+3.5. application of additional terms
+
+     you may choose to offer, and to charge a fee for, warranty, support,
+     indemnity or liability obligations to one or more recipients of covered
+     software. however, you may do so only on your own behalf, and not on
+     behalf of any contributor. you must make it absolutely clear that any
+     such warranty, support, indemnity, or liability obligation is offered by
+     you alone, and you hereby agree to indemnify every contributor for any
+     liability incurred by such contributor as a result of warranty, support,
+     indemnity or liability terms you offer. you may include additional
+     disclaimers of warranty and limitations of liability specific to any
+     jurisdiction.
+
+4. inability to comply due to statute or regulation
+
+   if it is impossible for you to comply with any of the terms of this license
+   with respect to some or all of the covered software due to statute,
+   judicial order, or regulation then you must: (a) comply with the terms of
+   this license to the maximum extent possible; and (b) describe the
+   limitations and the code they affect. such description must be placed in a
+   text file included with all distributions of the covered software under
+   this license. except to the extent prohibited by statute or regulation,
+   such description must be sufficiently detailed for a recipient of ordinary
+   skill to be able to understand it.
+
+5. termination
+
+5.1. the rights granted under this license will terminate automatically if you
+     fail to comply with any of its terms. however, if you become compliant,
+     then the rights granted under this license from a particular contributor
+     are reinstated (a) provisionally, unless and until such contributor
+     explicitly and finally terminates your grants, and (b) on an ongoing
+     basis, if such contributor fails to notify you of the non-compliance by
+     some reasonable means prior to 60 days after you have come back into
+     compliance. moreover, your grants from a particular contributor are
+     reinstated on an ongoing basis if such contributor notifies you of the
+     non-compliance by some reasonable means, this is the first time you have
+     received notice of non-compliance with this license from such
+     contributor, and you become compliant prior to 30 days after your receipt
+     of the notice.
+
+5.2. if you initiate litigation against any entity by asserting a patent
+     infringement claim (excluding declaratory judgment actions,
+     counter-claims, and cross-claims) alleging that a contributor version
+     directly or indirectly infringes any patent, then the rights granted to
+     you by any and all contributors for the covered software under section
+     2.1 of this license shall terminate.
+
+5.3. in the event of termination under sections 5.1 or 5.2 above, all end user
+     license agreements (excluding distributors and resellers) which have been
+     validly granted by you or your distributors under this license prior to
+     termination shall survive termination.
+
+6. disclaimer of warranty
+
+   covered software is provided under this license on an "as is" basis,
+   without warranty of any kind, either expressed, implied, or statutory,
+   including, without limitation, warranties that the covered software is free
+   of defects, merchantable, fit for a particular purpose or non-infringing.
+   the entire risk as to the quality and performance of the covered software
+   is with you. should any covered software prove defective in any respect,
+   you (not any contributor) assume the cost of any necessary servicing,
+   repair, or correction. this disclaimer of warranty constitutes an essential
+   part of this license. no use of  any covered software is authorized under
+   this license except under this disclaimer.
+
+7. limitation of liability
+
+   under no circumstances and under no legal theory, whether tort (including
+   negligence), contract, or otherwise, shall any contributor, or anyone who
+   distributes covered software as permitted above, be liable to you for any
+   direct, indirect, special, incidental, or consequential damages of any
+   character including, without limitation, damages for lost profits, loss of
+   goodwill, work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses, even if such party shall have been
+   informed of the possibility of such damages. this limitation of liability
+   shall not apply to liability for death or personal injury resulting from
+   such party's negligence to the extent applicable law prohibits such
+   limitation. some jurisdictions do not allow the exclusion or limitation of
+   incidental or consequential damages, so this exclusion and limitation may
+   not apply to you.
+
+8. litigation
+
+   any litigation relating to this license may be brought only in the courts
+   of a jurisdiction where the defendant maintains its principal place of
+   business and such litigation shall be governed by laws of that
+   jurisdiction, without reference to its conflict-of-law provisions. nothing
+   in this section shall prevent a party's ability to bring cross-claims or
+   counter-claims.
+
+9. miscellaneous
+
+   this license represents the complete agreement concerning the subject
+   matter hereof. if any provision of this license is held to be
+   unenforceable, such provision shall be reformed only to the extent
+   necessary to make it enforceable. any law or regulation which provides that
+   the language of a contract shall be construed against the drafter shall not
+   be used to construe this license against a contributor.
+
+
+10. versions of the license
+
+10.1. new versions
+
+      mozilla foundation is the license steward. except as provided in section
+      10.3, no one other than the license steward has the right to modify or
+      publish new versions of this license. each version will be given a
+      distinguishing version number.
+
+10.2. effect of new versions
+
+      you may distribute the covered software under the terms of the version
+      of the license under which you originally received the covered software,
+      or under the terms of any subsequent version published by the license
+      steward.
+
+10.3. modified versions
+
+      if you create software not governed by this license, and you want to
+      create a new license for such software, you may create and use a
+      modified version of this license if you rename the license and remove
+      any references to the name of the license steward (except to note that
+      such modified license differs from this license).
+
+10.4. distributing source code form that is incompatible with secondary
+      licenses if you choose to distribute source code form that is
+      incompatible with secondary licenses under the terms of this version of
+      the license, the notice described in exhibit b of this license must be
+      attached.
+
+exhibit a - source code form license notice
+
+      this source code form is subject to the
+      terms of the mozilla public license, v.
+      2.0. if a copy of the mpl was not
+      distributed with this file, you can
+      obtain one at
+      http://mozilla.org/mpl/2.0/.
+
+if it is not possible or desirable to put the notice in a particular file,
+then you may include the notice in a location (such as a license file in a
+relevant directory) where a recipient would be likely to look for such a
+notice.
+
+you may add additional accurate notices of copyright ownership.
+
+exhibit b - "incompatible with secondary licenses" notice
+
+      this source code form is "incompatible
+      with secondary licenses", as defined by
+      the mozilla public license, v. 2.0.
diff --git a/assets/styles.yaml b/assets/styles.yaml
index 6d971f2..2117899 100644
--- a/assets/styles.yaml
+++ b/assets/styles.yaml
@@ -90,6 +90,15 @@
   middle: ~
   end: '*}'
 
+- id: PHP
+  start: |
+    <?php
+    /*
+  middle: ' *'
+  end: |
+    */
+    ?>
+
 - id: PhpTag
   after: 
'(?mi)^<\?(php)?(\s+declare\s*\(\s*strict_types\s*=\s*[01]{1}\s*\)\s*;)?$'
   start: '/*'
diff --git a/commands/deps_resolve.go b/commands/deps_resolve.go
index 2068abe..c142d6e 100644
--- a/commands/deps_resolve.go
+++ b/commands/deps_resolve.go
@@ -45,8 +45,8 @@ var ResolveCommand = &cobra.Command{
                                pkgs[i] = s.Dependency
                        }
                        return fmt.Errorf(
-                               "failed to identify the licenses of following 
packages:\n%s",
-                               strings.Join(pkgs, "\n"),
+                               "failed to identify the licenses of following 
packages (%d):\n%s",
+                               len(pkgs), strings.Join(pkgs, "\n"),
                        )
                }
 
diff --git a/go.mod b/go.mod
index c8a8070..a45fe63 100644
--- a/go.mod
+++ b/go.mod
@@ -4,11 +4,11 @@ go 1.16
 
 require (
        github.com/bmatcuk/doublestar/v2 v2.0.4
+       github.com/google/go-cmp v0.3.0
        github.com/google/go-github/v33 v33.0.0
        github.com/sirupsen/logrus v1.7.0
        github.com/spf13/cobra v1.1.1
-       golang.org/x/mod v0.4.0
        golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
-       golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e
+       golang.org/x/tools v0.1.5
        gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
 )
diff --git a/go.sum b/go.sum
index f6581fa..99609a3 100644
--- a/go.sum
+++ b/go.sum
@@ -60,6 +60,7 @@ github.com/golang/protobuf v1.3.2/go.mod 
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod 
h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0/go.mod 
h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/go-cmp v0.2.0/go.mod 
h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
 github.com/google/go-cmp v0.3.0/go.mod 
h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-github/v33 v33.0.0 
h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM=
 github.com/google/go-github/v33 v33.0.0/go.mod 
h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg=
@@ -175,6 +176,7 @@ github.com/stretchr/testify v1.3.0/go.mod 
h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
 github.com/subosito/gotenv v1.2.0/go.mod 
h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod 
h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod 
h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+github.com/yuin/goldmark v1.3.5/go.mod 
h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
@@ -206,8 +208,8 @@ golang.org/x/mobile 
v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU
 golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod 
h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
 golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod 
h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
 golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
-golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod 
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod 
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod 
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -221,8 +223,9 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod 
h1:t9HGtf8HONx5eT2rtn
 golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod 
h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod 
h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod 
h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859 
h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod 
h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 
h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod 
h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod 
h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod 
h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 
h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
@@ -232,6 +235,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod 
h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod 
h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod 
h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod 
h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -245,11 +249,16 @@ golang.org/x/sys 
v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 
h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007 
h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod 
h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod 
h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod 
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod 
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod 
h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -269,11 +278,13 @@ golang.org/x/tools 
v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn
 golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod 
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod 
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod 
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e 
h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ=
 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod 
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
+golang.org/x/tools v0.1.5/go.mod 
h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod 
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 
h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod 
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 
h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod 
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/api v0.4.0/go.mod 
h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 google.golang.org/api v0.7.0/go.mod 
h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 google.golang.org/api v0.8.0/go.mod 
h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
diff --git a/pkg/deps/golang.go b/pkg/deps/golang.go
index 322ab47..99dd917 100644
--- a/pkg/deps/golang.go
+++ b/pkg/deps/golang.go
@@ -18,20 +18,20 @@
 package deps
 
 import (
-       "context"
-       "fmt"
+       "bytes"
+       "encoding/json"
        "go/build"
+       "io"
        "io/ioutil"
        "os"
+       "os/exec"
        "path/filepath"
        "regexp"
        "strings"
 
-       "golang.org/x/mod/modfile"
-       "golang.org/x/tools/go/packages"
-
        "github.com/apache/skywalking-eyes/license-eye/internal/logger"
        "github.com/apache/skywalking-eyes/license-eye/pkg/license"
+       "golang.org/x/tools/go/packages"
 )
 
 type GoModResolver struct {
@@ -46,30 +46,31 @@ func (resolver *GoModResolver) CanResolve(file string) bool 
{
 
 // Resolve resolves licenses of all dependencies declared in the go.mod file.
 func (resolver *GoModResolver) Resolve(goModFile string, report *Report) error 
{
-       content, err := ioutil.ReadFile(goModFile)
-       if err != nil {
+       if err := os.Chdir(filepath.Dir(goModFile)); err != nil {
                return err
        }
 
-       file, err := modfile.Parse(goModFile, content, nil)
+       output, err := exec.Command("go", "list", "-m", "-json", "all").Output()
        if err != nil {
                return err
        }
 
-       logger.Log.Debugln("Resolving module:", file.Module.Mod)
-
-       if err := os.Chdir(filepath.Dir(goModFile)); err != nil {
-               return err
-       }
-
-       requiredPkgNames := make([]string, len(file.Require))
-       for i, require := range file.Require {
-               requiredPkgNames[i] = require.Mod.Path
+       modules := make([]packages.Module, 0)
+       decoder := json.NewDecoder(bytes.NewReader(output))
+       for {
+               var m packages.Module
+               if err := decoder.Decode(&m); err != nil {
+                       if err == io.EOF {
+                               break
+                       }
+                       return err
+               }
+               modules = append(modules, m)
        }
 
-       logger.Log.Debugln("Required packages:", requiredPkgNames)
+       logger.Log.Debugln("Module size:", len(modules))
 
-       if err := resolver.ResolvePackages(requiredPkgNames, report); err != 
nil {
+       if err := resolver.ResolvePackages(modules, report); err != nil {
                return err
        }
 
@@ -77,67 +78,28 @@ func (resolver *GoModResolver) Resolve(goModFile string, 
report *Report) error {
 }
 
 // ResolvePackages resolves the licenses of the given packages.
-func (resolver *GoModResolver) ResolvePackages(pkgNames []string, report 
*Report) error {
-       requiredPkgs, err := packages.Load(&packages.Config{
-               Context: context.Background(),
-               Mode:    packages.NeedName | packages.NeedFiles | 
packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedDeps,
-       }, pkgNames...)
-
-       if err != nil {
-               return err
-       }
-
-       packages.Visit(requiredPkgs, func(p *packages.Package) bool {
-               if isBuiltIn(p) {
-                       logger.Log.Debugln("Built-in package doesn't require 
license check:", p.PkgPath)
-                       return false
-               }
-
-               if len(p.Errors) > 0 {
-                       logger.Log.Warnln("Failed to visit package:", 
p.PkgPath, p.Errors)
-                       report.Skip(&Result{
-                               Dependency:    p.PkgPath,
-                               LicenseSpdxID: Unknown,
-                       })
-                       return true
-               }
-               err := resolver.ResolvePackageLicense(p, report)
+func (resolver *GoModResolver) ResolvePackages(modules []packages.Module, 
report *Report) error {
+       for _, module := range modules {
+               err := resolver.ResolvePackageLicense(module, report)
                if err != nil {
-                       logger.Log.Warnln("Failed to resolve the license of 
dependency:", p.PkgPath, err)
+                       logger.Log.Warnln("Failed to resolve the license of 
dependency:", module.Path, err)
                        report.Skip(&Result{
-                               Dependency:    p.PkgPath,
+                               Dependency:    module.Path,
                                LicenseSpdxID: Unknown,
                        })
                }
-               return true
-       }, nil)
+       }
 
        return nil
 }
 
 var possibleLicenseFileName = 
regexp.MustCompile(`(?i)^LICENSE|LICENCE(\.txt)?$`)
 
-func (resolver *GoModResolver) ResolvePackageLicense(p *packages.Package, 
report *Report) error {
-       var filesInPkg []string
-       if len(p.GoFiles) > 0 {
-               filesInPkg = p.GoFiles
-       } else if len(p.CompiledGoFiles) > 0 {
-               filesInPkg = p.CompiledGoFiles
-       } else if len(p.OtherFiles) > 0 {
-               filesInPkg = p.OtherFiles
-       }
-
-       if len(filesInPkg) == 0 {
-               return fmt.Errorf("empty package")
-       }
-
-       absPath, err := filepath.Abs(filesInPkg[0])
-       if err != nil {
-               return err
-       }
-       dir := filepath.Dir(absPath)
+func (resolver *GoModResolver) ResolvePackageLicense(module packages.Module, 
report *Report) error {
+       dir := module.Dir
 
        for {
+               logger.Log.Debugln("Dir:", dir)
                files, err := ioutil.ReadDir(dir)
                if err != nil {
                        return err
@@ -151,12 +113,12 @@ func (resolver *GoModResolver) ResolvePackageLicense(p 
*packages.Package, report
                        if err != nil {
                                return err
                        }
-                       identifier, err := license.Identify(p.PkgPath, 
string(content))
+                       identifier, err := license.Identify(module.Path, 
string(content))
                        if err != nil {
                                return err
                        }
                        report.Resolve(&Result{
-                               Dependency:      p.PkgPath,
+                               Dependency:      module.Path,
                                LicenseFilePath: licenseFilePath,
                                LicenseContent:  string(content),
                                LicenseSpdxID:   identifier,
@@ -172,12 +134,7 @@ func (resolver *GoModResolver) ResolvePackageLicense(p 
*packages.Package, report
 }
 
 func (resolver *GoModResolver) shouldStopAt(dir string) bool {
-       for _, srcDir := range build.Default.SrcDirs() {
-               if srcDir == dir {
-                       return true
-               }
-       }
-       return false
+       return dir == build.Default.GOPATH
 }
 
 func isBuiltIn(pkg *packages.Package) bool {
diff --git a/pkg/license/identifier.go b/pkg/license/identifier.go
index dd21112..95b95de 100644
--- a/pkg/license/identifier.go
+++ b/pkg/license/identifier.go
@@ -24,6 +24,7 @@ import (
        "strings"
 
        "github.com/apache/skywalking-eyes/license-eye/assets"
+       "github.com/apache/skywalking-eyes/license-eye/internal/logger"
 )
 
 const templatesDir = "lcs-templates"
@@ -58,10 +59,12 @@ func Identify(pkgPath, content string) (string, error) {
                }
                license := string(t)
                license = Normalize(license)
-               if license == content {
+               if strings.Contains(content, license) {
                        return strings.TrimSuffix(templateName, 
filepath.Ext(templateName)), nil
                }
        }
 
+       logger.Log.Debugf("Normalized content for %+v:\n%+v\n", pkgPath, 
content)
+
        return "", fmt.Errorf("cannot identify license content")
 }
diff --git a/pkg/license/norm.go b/pkg/license/norm.go
index 96dbd80..1c2a635 100644
--- a/pkg/license/norm.go
+++ b/pkg/license/norm.go
@@ -125,10 +125,36 @@ var (
                {regexp.MustCompile(`(?i)\bwilfull\b`), "wilful"},
 
                {regexp.MustCompile(`©`), "Copyright "},
-               {regexp.MustCompile(`\(c\)`), "Copyright "},
+               {regexp.MustCompile(`\(([cC])\)`), "Copyright "},
                {regexp.MustCompile(`\bhttps://`), "http://"},
 
+               {regexp.MustCompile(`“`), `"`},
+               {regexp.MustCompile(`”`), `"`},
+               {regexp.MustCompile(`’`), "'"},
+
                {regexp.MustCompile(`(?i)\b(the )?Apache Software Foundation( 
\(ASF\))?`), "the ASF"},
+
+               // Prettier chars
+               {regexp.MustCompile(`[-=*]{3,}`), ""},
+
+               // Misc
+               {
+                       regexp.MustCompile(`(?i)Mozilla Public License version 
2\.0`),
+                       "Mozilla Public License, Version 2.0",
+               },
+
+               {
+                       regexp.MustCompile(`(?i)IN NO EVENT SHALL (.+?) BE 
LIABLE`),
+                       "IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
BE LIABLE",
+               },
+               {
+                       regexp.MustCompile(`(?i)The names of (its|the) 
contributors may not be used to endorse`),
+                       "Neither the name of the copyright holder nor the names 
of its contributors may be used to endorse",
+               },
+               {
+                       regexp.MustCompile(`(?i)(neither the name of) (.+?) 
(nor the names of)`),
+                       "$1 the copyright holder $3",
+               },
        }
 
        variables = []struct {
@@ -136,27 +162,59 @@ var (
                replacement string
        }{
                // BSD-3-Clause
+               // MIT
+               { // remove optional header
+                       regexp.MustCompile(`(?im)^\s*(The )?MIT License( 
\((MIT|Expat)\))?$`),
+                       "",
+               },
+               // ISC
+               { // remove optional header
+                       regexp.MustCompile(`(?im)^\s*(The )?ISC License$`),
+                       "",
+               },
+               // ISC
+
+               {
+                       regexp.MustCompile(`(?im)\(including the next 
paragraph\)`),
+                       "",
+               },
+       }
+
+       lineProcessors = []struct {
+               regexp      *regexp.Regexp
+               replacement string
+       }{
+               // leading chars such as >, * just for pretty printing
                {
-                       regexp.MustCompile(`(?im)(^(\s*Copyright \(c\)) (\d{4}) 
(.+?) (All rights reserved\.)?$\n?)+`),
-                       "$2 [year] [owner]. $5",
+                       regexp.MustCompile(`(?m)^[>*]\s+`),
+                       " ",
                },
+               // Listing bullets such as a., b., 1., 2.
                {
-                       regexp.MustCompile(`(?i)(neither the name of) (.+?) 
(nor the names of)`),
-                       "$1 the copyright holder $3",
+                       regexp.MustCompile(`(?m)^\s*[a-z0-9]\. `),
+                       " ",
                },
-               // MIT
-               { // remove optional header
-                       regexp.MustCompile(`(?im)^\s*The MIT License \(MIT\)$`),
-                       "",
+               // Listing bullets such as (a), (b), (1), (2)
+               {
+                       regexp.MustCompile(`(?m)^\s*\([a-z0-9]\) `),
+                       " ",
                },
+               // trailing chars such as >, * just for pretty printing
                {
-                       regexp.MustCompile(`(?im)^(\s*Copyright \(c\)) (\d{4}) 
(.+?)$`),
-                       "$1 [year] [owner]",
+                       regexp.MustCompile(`(?m)\s+[*]$`),
+                       " ",
                },
+               // Copyright (c) .....
                {
-                       regexp.MustCompile(`(?im)\(including the next 
paragraph\)`),
+                       regexp.MustCompile(`(?m)^\s*Copyright (\([cC©]\))?.+$`),
                        "",
                },
+
+               // This should be the last one processor
+               {
+                       regexp.MustCompile("[\n\r]+"),
+                       " ",
+               },
        }
 )
 
@@ -181,15 +239,19 @@ func NormalizeHeader(header string) string {
 
 // Normalize applies a chain of Normalizers to the license text to make it 
cleaner for identification.
 func Normalize(license string) string {
-       for _, normalize := range normalizers {
+       ns := append([]Normalizer{CommentIndicatorNormalizer}, normalizers...)
+       for _, normalize := range ns {
                license = normalize(license)
        }
        return license
 }
 
-// OneLineNormalizer simply removes all line breaks to flatten the license 
text into one line.
+// OneLineNormalizer normalizes the text line by line and finally merge them 
into one line.
 func OneLineNormalizer(text string) string {
-       return regexp.MustCompile("[\n\r]+").ReplaceAllString(text, " ")
+       for _, s := range lineProcessors {
+               text = s.regexp.ReplaceAllString(text, s.replacement)
+       }
+       return text
 }
 
 // SubstantiveTextsNormalizer normalizes the license text by substituting some 
words that
diff --git a/test.go b/test.go
new file mode 100644
index 0000000..d110cee
--- /dev/null
+++ b/test.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+       "github.com/apache/skywalking-eyes/license-eye/pkg/license"
+       "github.com/google/go-cmp/cmp"
+)
+
+func main() {
+       l := license.Normalize(`
+ISC License
+
+Copyright (c) 2012-2016 Dave Collins <[email protected]>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+`)
+       s := license.Normalize(`
+Copyright [year] [owner]
+
+Permission to use, copy, modify, and/or distribute this software for any 
purpose with or without fee is hereby granted, provided that the above 
copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
PERFORMANCE OF THIS SOFTWARE.
+`)
+
+       _ = cmp.Diff(l, s)
+       println(l)
+}
diff --git a/test.php b/test.php
new file mode 100644
index 0000000..04bbf86
--- /dev/null
+++ b/test.php
@@ -0,0 +1,29 @@
+<?php
+/*
+
+ * Licensed to Apache Software Foundation (ASF) under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+*/
+?>
+<?php
+// This is valid:
+declare(ticks=1);
+
+// This is invalid:
+const TICK_VALUE = 1;
+declare(ticks=TICK_VALUE);
+?>

Reply via email to