Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 136... Línea 136...
136
            self::emit_deprecation_notice($attribute);
136
            self::emit_deprecation_notice($attribute);
137
        }
137
        }
138
    }
138
    }
Línea 139... Línea 139...
139
 
139
 
-
 
140
    /**
-
 
141
     * Emit a deprecation notice for a reference.
-
 
142
     *
-
 
143
     * This will emit a deprecation notice if the reference is deprecated.
-
 
144
     * If the reference is not deprecated, the function will emit debugging information.
-
 
145
     *
-
 
146
     * @param array|string|object $reference
-
 
147
     */
-
 
148
    public static function emit_deprecation(array|string|object $reference): void {
-
 
149
        if ($attribute = self::from($reference)) {
-
 
150
            self::emit_deprecation_notice($attribute);
-
 
151
        } else {
-
 
152
            // If the reference is not deprecated, we should not emit a notice.
-
 
153
            // This is to prevent false positives in tests.
-
 
154
            debugging(
-
 
155
                "Deprecation notice requested but object is not deprecated.",
-
 
156
                DEBUG_DEVELOPER,
-
 
157
            );
-
 
158
        }
-
 
159
    }
-
 
160
 
140
    /**
161
    /**
141
     * Fetch a referenced deprecation attribute from a reflected object.
162
     * Fetch a referenced deprecation attribute from a reflected object.
142
     *
163
     *
143
     * @param \ReflectionClass $rc The reflected object
164
     * @param \ReflectionClass $rc The reflected object
144
     * @param null|string $name The name of the thing to check for deprecation
165
     * @param null|string $name The name of the thing to check for deprecation